SELECT 
  v.product_id, 
  v.feature_id, 
  v.value, 
  v.value_int, 
  v.variant_id, 
  f.feature_type, 
  fd.description, 
  fd.prefix, 
  fd.suffix, 
  vd.variant, 
  f.parent_id, 
  f.position, 
  gf.position as gposition 
FROM 
  cscart_product_features as f 
  LEFT JOIN cscart_product_features_values as v ON v.feature_id = f.feature_id 
  LEFT JOIN cscart_product_features_descriptions as fd ON fd.feature_id = v.feature_id 
  AND fd.lang_code = 'ar' 
  LEFT JOIN cscart_product_feature_variants fv ON fv.variant_id = v.variant_id 
  LEFT JOIN cscart_product_feature_variant_descriptions as vd ON vd.variant_id = fv.variant_id 
  AND vd.lang_code = 'ar' 
  LEFT JOIN cscart_product_features as gf ON gf.feature_id = f.parent_id 
  AND gf.feature_type = 'G' 
WHERE 
  f.status IN ('A') 
  AND v.product_id in (
    4482, 4483, 4480, 4481, 4474, 4572, 4477, 
    4547, 4545, 4551, 4484, 4550, 4546, 
    4549, 4479
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(166, f.categories_path) 
    OR FIND_IN_SET(167, f.categories_path) 
    OR FIND_IN_SET(519, f.categories_path)
  ) 
  AND IF(
    f.parent_id, 
    (
      SELECT 
        status 
      FROM 
        cscart_product_features as df 
      WHERE 
        df.feature_id = f.parent_id
    ), 
    'A'
  ) IN ('A') 
  AND (
    v.variant_id != 0 
    OR (
      f.feature_type != 'C' 
      AND v.value != ''
    ) 
    OR (f.feature_type = 'C') 
    OR v.value_int != ''
  ) 
  AND v.lang_code = 'ar' 
ORDER BY 
  fd.description, 
  fv.position

Query time 0.00597

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "274.56"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "v",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "fl",
              "variant_id",
              "lang_code",
              "product_id",
              "fpl",
              "idx_product_feature_variant_id"
            ],
            "key": "idx_product_feature_variant_id",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 446,
            "rows_produced_per_join": 145,
            "filtered": "32.51",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (4482,4483,4480,4481,4474,4572,4477,4547,4545,4551,4484,4550,4546,4549,4479)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "189.96",
              "eval_cost": "14.50",
              "prefix_cost": "204.46",
              "data_read_per_join": "112K"
            },
            "used_columns": [
              "feature_id",
              "product_id",
              "variant_id",
              "value",
              "value_int",
              "lang_code"
            ]
          }
        },
        {
          "table": {
            "table_name": "f",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "status"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "feature_id"
            ],
            "key_length": "3",
            "ref": [
              "softwarepirmam_hewadelivard_cscart_4.v.feature_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 13,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "36.25",
              "eval_cost": "1.38",
              "prefix_cost": "255.22",
              "data_read_per_join": "5K"
            },
            "used_columns": [
              "feature_id",
              "feature_type",
              "categories_path",
              "parent_id",
              "display_on_catalog",
              "status",
              "position"
            ],
            "attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`f`.`status` = 'A') and (`softwarepirmam_hewadelivard_cscart_4`.`f`.`display_on_catalog` = 'Y') and ((`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path` = '') or (0 <> find_in_set(166,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(167,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(519,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`))) and (if(`softwarepirmam_hewadelivard_cscart_4`.`f`.`parent_id`,(/* select#2 */ select `softwarepirmam_hewadelivard_cscart_4`.`df`.`status` from `softwarepirmam_hewadelivard_cscart_4`.`cscart_product_features` `df` where (`softwarepirmam_hewadelivard_cscart_4`.`df`.`feature_id` = `softwarepirmam_hewadelivard_cscart_4`.`f`.`parent_id`)),'A') = 'A') and ((`softwarepirmam_hewadelivard_cscart_4`.`v`.`variant_id` <> 0) or ((`softwarepirmam_hewadelivard_cscart_4`.`f`.`feature_type` <> 'C') and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`value` <> '')) or (`softwarepirmam_hewadelivard_cscart_4`.`f`.`feature_type` = 'C') or (`softwarepirmam_hewadelivard_cscart_4`.`v`.`value_int` <> 0)))",
            "attached_subqueries": [
              {
                "dependent": true,
                "cacheable": false,
                "query_block": {
                  "select_id": 2,
                  "cost_info": {
                    "query_cost": "0.35"
                  },
                  "table": {
                    "table_name": "df",
                    "access_type": "eq_ref",
                    "possible_keys": [
                      "PRIMARY"
                    ],
                    "key": "PRIMARY",
                    "used_key_parts": [
                      "feature_id"
                    ],
                    "key_length": "3",
                    "ref": [
                      "softwarepirmam_hewadelivard_cscart_4.f.parent_id"
                    ],
                    "rows_examined_per_scan": 1,
                    "rows_produced_per_join": 1,
                    "filtered": "100.00",
                    "cost_info": {
                      "read_cost": "0.25",
                      "eval_cost": "0.10",
                      "prefix_cost": "0.35",
                      "data_read_per_join": "440"
                    },
                    "used_columns": [
                      "feature_id",
                      "status"
                    ]
                  }
                }
              }
            ]
          }
        },
        {
          "table": {
            "table_name": "fd",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "feature_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "softwarepirmam_hewadelivard_cscart_4.v.feature_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 13,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.45",
              "eval_cost": "1.38",
              "prefix_cost": "260.05",
              "data_read_per_join": "31K"
            },
            "used_columns": [
              "feature_id",
              "description",
              "prefix",
              "suffix",
              "lang_code"
            ]
          }
        },
        {
          "table": {
            "table_name": "fv",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "variant_id"
            ],
            "key_length": "3",
            "ref": [
              "softwarepirmam_hewadelivard_cscart_4.v.variant_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 13,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.45",
              "eval_cost": "1.38",
              "prefix_cost": "264.89",
              "data_read_per_join": "15K"
            },
            "used_columns": [
              "variant_id",
              "position"
            ]
          }
        },
        {
          "table": {
            "table_name": "vd",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "variant_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "softwarepirmam_hewadelivard_cscart_4.fv.variant_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 13,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.45",
              "eval_cost": "1.38",
              "prefix_cost": "269.72",
              "data_read_per_join": "41K"
            },
            "used_columns": [
              "variant_id",
              "variant",
              "lang_code"
            ]
          }
        },
        {
          "table": {
            "table_name": "gf",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "feature_id"
            ],
            "key_length": "3",
            "ref": [
              "softwarepirmam_hewadelivard_cscart_4.f.parent_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 13,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.45",
              "eval_cost": "1.38",
              "prefix_cost": "274.56",
              "data_read_per_join": "5K"
            },
            "used_columns": [
              "feature_id",
              "feature_type",
              "position"
            ],
            "attached_condition": "<if>(is_not_null_compl(gf), (`softwarepirmam_hewadelivard_cscart_4`.`gf`.`feature_type` = 'G'), true)"
          }
        }
      ]
    }
  }
}

Result

product_id feature_id value value_int variant_id feature_type description prefix suffix variant parent_id position gposition
4572 641 1647 S Aspect Ratio 16:9 0 30
4474 659 4102 S Connectivity Wi-Fi 6, Bluetooth 5.2 or 5.3 0 152
4477 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4479 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4480 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4481 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4482 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4483 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4484 659 5719 S Connectivity Wi-Fi 6, Bluetooth 5.3 0 152
4545 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4546 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4547 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4549 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4550 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4551 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4474 649 1938 S Display 24" 0 20
4477 649 1938 S Display 24" 0 20
4479 649 1938 S Display 24" 0 20
4480 649 1938 S Display 24" 0 20
4481 649 1731 S Display 27" 0 20
4482 649 1731 S Display 27" 0 20
4483 649 1938 S Display 24" 0 20
4484 649 1731 S Display 27" 0 20
4545 649 1731 S Display 27" 0 20
4546 649 1731 S Display 27" 0 20
4547 649 1938 S Display 24" 0 20
4549 649 1938 S Display 24" 0 20
4550 649 1731 S Display 27" 0 20
4551 649 1939 S Display 32" 0 20
4572 649 1938 S Display 24" 0 20
4474 647 1854 S Front Camera 5MP 0 150
4477 647 1854 S Front Camera 5MP 0 150
4479 647 1854 S Front Camera 5MP 0 150
4480 647 1854 S Front Camera 5MP 0 150
4481 647 1854 S Front Camera 5MP 0 150
4482 647 1854 S Front Camera 5MP 0 150
4483 647 1854 S Front Camera 5MP 0 150
4484 647 1854 S Front Camera 5MP 0 150
4545 647 1854 S Front Camera 5MP 0 150
4546 647 1854 S Front Camera 5MP 0 150
4547 647 1854 S Front Camera 5MP 0 150
4549 647 1854 S Front Camera 5MP 0 150
4550 647 1854 S Front Camera 5MP 0 150
4551 647 1854 S Front Camera 5MP 0 150
4474 640 4403 S Operating System Windows 11 Home 0 10
4477 640 4403 S Operating System Windows 11 Home 0 10
4479 640 4403 S Operating System Windows 11 Home 0 10
4480 640 4403 S Operating System Windows 11 Home 0 10
4481 640 4403 S Operating System Windows 11 Home 0 10
4482 640 4403 S Operating System Windows 11 Home 0 10
4483 640 4403 S Operating System Windows 11 Home 0 10
4484 640 4403 S Operating System Windows 11 Home 0 10
4545 640 4403 S Operating System Windows 11 Home 0 10
4546 640 4403 S Operating System Windows 11 Home 0 10
4547 640 4403 S Operating System Windows 11 Home 0 10
4549 640 4403 S Operating System Windows 11 Home 0 10
4550 640 4403 S Operating System Windows 11 Home 0 10
4551 640 4403 S Operating System Windows 11 Home 0 10
4474 645 5550 S Ports USB 3.2, USB 2.0, HDMI, Ethernet, Audio jack 0 110
4477 645 5550 S Ports USB 3.2, USB 2.0, HDMI, Ethernet, Audio jack 0 110
4479 645 5550 S Ports USB 3.2, USB 2.0, HDMI, Ethernet, Audio jack 0 110
4480 645 5550 S Ports USB 3.2, USB 2.0, HDMI, Ethernet, Audio jack 0 110
4481 645 5550 S Ports USB 3.2, USB 2.0, HDMI, Ethernet, Audio jack 0 110
4482 645 5550 S Ports USB 3.2, USB 2.0, HDMI, Ethernet, Audio jack 0 110
4483 645 5550 S Ports USB 3.2, USB 2.0, HDMI, Ethernet, Audio jack 0 110
4484 645 5550 S Ports USB 3.2, USB 2.0, HDMI, Ethernet, Audio jack 0 110
4545 645 5623 S Ports USB Type-A, USB Type-C, HDMI-in/out, audio jack, Ethernet 0 110
4546 645 5623 S Ports USB Type-A, USB Type-C, HDMI-in/out, audio jack, Ethernet 0 110
4547 645 5623 S Ports USB Type-A, USB Type-C, HDMI-in/out, audio jack, Ethernet 0 110
4549 645 5623 S Ports USB Type-A, USB Type-C, HDMI-in/out, audio jack, Ethernet 0 110
4550 645 5623 S Ports USB Type-A, USB Type-C, HDMI-in/out, audio jack, Ethernet 0 110
4551 645 5623 S Ports USB Type-A, USB Type-C, HDMI-in/out, audio jack, Ethernet 0 110
4572 645 5675 S Ports 1 x HDMI, 1 x USB-C, 2 x USB-A, 1 x Audio Out, 1 x DC IN power 0 110
4474 651 2251 S Processor 12th Gen Intel® Core™ i5-1235U (10 cores: 2 performance cores + 8 efficiency cores, up to 4.4 GHz) 0 60
4477 651 2251 S Processor 12th Gen Intel® Core™ i5-1235U (10 cores: 2 performance cores + 8 efficiency cores, up to 4.4 GHz) 0 60
4479 651 2251 S Processor 12th Gen Intel® Core™ i5-1235U (10 cores: 2 performance cores + 8 efficiency cores, up to 4.4 GHz) 0 60
4480 651 2251 S Processor 12th Gen Intel® Core™ i5-1235U (10 cores: 2 performance cores + 8 efficiency cores, up to 4.4 GHz) 0 60
4483 651 2251 S Processor 12th Gen Intel® Core™ i5-1235U (10 cores: 2 performance cores + 8 efficiency cores, up to 4.4 GHz) 0 60
4481 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4482 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4484 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4545 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4546 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4547 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4549 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4550 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4551 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4474 650 1539 S Refresh Rate 60Hz 0 40
4477 650 1539 S Refresh Rate 60Hz 0 40
4479 650 5218 S Refresh Rate 60 Hz 0 40
4480 650 5218 S Refresh Rate 60 Hz 0 40
4481 650 5218 S Refresh Rate 60 Hz 0 40
4482 650 1539 S Refresh Rate 60Hz 0 40
4483 650 5218 S Refresh Rate 60 Hz 0 40
4484 650 1539 S Refresh Rate 60Hz 0 40
4545 650 1539 S Refresh Rate 60Hz 0 40
4546 650 1539 S Refresh Rate 60Hz 0 40
4547 650 1539 S Refresh Rate 60Hz 0 40
4549 650 1539 S Refresh Rate 60Hz 0 40
4550 650 1539 S Refresh Rate 60Hz 0 40
4551 650 1539 S Refresh Rate 60Hz 0 40
4572 650 1539 S Refresh Rate 60Hz 0 40
4474 642 4211 S Resolution 1920 x 1080 0 50
4477 642 4211 S Resolution 1920 x 1080 0 50
4479 642 4211 S Resolution 1920 x 1080 0 50
4480 642 4211 S Resolution 1920 x 1080 0 50
4481 642 4211 S Resolution 1920 x 1080 0 50
4482 642 4211 S Resolution 1920 x 1080 0 50
4483 642 4211 S Resolution 1920 x 1080 0 50
4484 642 5718 S Resolution 1920 × 1080 0 50
4545 642 4211 S Resolution 1920 x 1080 0 50
4546 642 4211 S Resolution 1920 x 1080 0 50
4547 642 5622 S Resolution 1920×1080 0 50
4549 642 5622 S Resolution 1920×1080 0 50
4550 642 5622 S Resolution 1920×1080 0 50
4551 642 5628 S Resolution 2560×1440 0 50
4572 642 1588 S Resolution 1920 x 1080 (full HD) 0 50
4474 648 1563 S التخزين 512GB 0 170
4477 648 1563 S التخزين 512GB 0 170
4479 648 1563 S التخزين 512GB 0 170
4480 648 1563 S التخزين 512GB 0 170
4483 648 1563 S التخزين 512GB 0 170
4484 648 1563 S التخزين 512GB 0 170
4545 648 1563 S التخزين 512GB 0 170
4546 648 1563 S التخزين 512GB 0 170
4547 648 1563 S التخزين 512GB 0 170
4549 648 1563 S التخزين 512GB 0 170
4481 648 1564 S التخزين 1TB 0 170
4482 648 1564 S التخزين 1TB 0 170
4550 648 1564 S التخزين 1TB 0 170
4551 648 1564 S التخزين 1TB 0 170
4474 656 5552 S لون Starry White 0 160
4477 656 5556 S لون Shell White 0 160
4479 656 5556 S لون Shell White 0 160
4480 656 5556 S لون Shell White 0 160
4481 656 1559 S لون White 0 160
4482 656 5556 S لون Shell White 0 160
4483 656 5563 S لون Jet Black 0 160
4484 656 1559 S لون White 0 160
4545 656 1560 S لون Black 0 160
4546 656 1559 S لون White 0 160
4547 656 5556 S لون Shell White 0 160
4549 656 1559 S لون White 0 160
4550 656 1560 S لون Black 0 160
4551 656 5630 S لون Sparkling Black 0 160
4572 656 1559 S لون White 0 160
4474 657 4960 E ماركة HP 0 0
4477 657 4960 E ماركة HP 0 0
4479 657 4960 E ماركة HP 0 0
4480 657 4960 E ماركة HP 0 0
4481 657 4960 E ماركة HP 0 0
4482 657 4960 E ماركة HP 0 0
4483 657 4960 E ماركة HP 0 0
4484 657 4960 E ماركة HP 0 0
4545 657 4960 E ماركة HP 0 0
4546 657 4960 E ماركة HP 0 0
4547 657 4960 E ماركة HP 0 0
4549 657 4960 E ماركة HP 0 0
4550 657 4960 E ماركة HP 0 0
4551 657 4960 E ماركة HP 0 0
4572 657 5650 E ماركة Asus 0 0