SELECT 
  parent_option_id, 
  child_option_id, 
  parent_variant_id, 
  child_variant_id 
FROM 
  cscart_nested_option_rules 
WHERE 
  product_id = 8761 
ORDER BY 
  parent_option_id, 
  child_option_id, 
  position, 
  nested_rule_id

Query time 0.00050

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "3.15"
    },
    "ordering_operation": {
      "using_filesort": true,
      "table": {
        "table_name": "cscart_nested_option_rules",
        "access_type": "ref",
        "possible_keys": [
          "idx_product",
          "idx_product_parent"
        ],
        "key": "idx_product",
        "used_key_parts": [
          "product_id"
        ],
        "key_length": "4",
        "ref": [
          "const"
        ],
        "rows_examined_per_scan": 9,
        "rows_produced_per_join": 9,
        "filtered": "100.00",
        "cost_info": {
          "read_cost": "2.25",
          "eval_cost": "0.90",
          "prefix_cost": "3.15",
          "data_read_per_join": "288"
        },
        "used_columns": [
          "nested_rule_id",
          "product_id",
          "parent_option_id",
          "child_option_id",
          "parent_variant_id",
          "child_variant_id",
          "position"
        ]
      }
    }
  }
}

Result

parent_option_id child_option_id parent_variant_id child_variant_id
64 65 439 454
64 65 439 458
64 65 445 459
64 65 445 460
64 65 445 462
65 67 451 467
65 67 456 468
65 67 461 469
65 67 461 466