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 (
    5998, 6007, 6005, 6019, 6013, 5980, 6006, 
    5981, 6024, 5983
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(166, f.categories_path) 
    OR FIND_IN_SET(329, f.categories_path) 
    OR FIND_IN_SET(457, 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.00224

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "95.41"
    },
    "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": "product_id",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 153,
            "rows_produced_per_join": 49,
            "filtered": "32.51",
            "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (5998,6007,6005,6019,6013,5980,6006,5981,6024,5983))",
            "cost_info": {
              "read_cost": "66.39",
              "eval_cost": "4.97",
              "prefix_cost": "71.36",
              "data_read_per_join": "38K"
            },
            "used_columns": [
              "feature_id",
              "product_id",
              "variant_id",
              "value",
              "value_int",
              "lang_code"
            ],
            "attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar') and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))"
          }
        },
        {
          "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": 4,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "12.44",
              "eval_cost": "0.47",
              "prefix_cost": "88.77",
              "data_read_per_join": "2K"
            },
            "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(329,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(457,`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": 4,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.18",
              "eval_cost": "0.47",
              "prefix_cost": "90.43",
              "data_read_per_join": "10K"
            },
            "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": 4,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.18",
              "eval_cost": "0.47",
              "prefix_cost": "92.09",
              "data_read_per_join": "5K"
            },
            "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": 4,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.18",
              "eval_cost": "0.47",
              "prefix_cost": "93.75",
              "data_read_per_join": "14K"
            },
            "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": 4,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.18",
              "eval_cost": "0.47",
              "prefix_cost": "95.41",
              "data_read_per_join": "2K"
            },
            "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
6019 654 0.00 7749 S Charging Type Charges via USB-C, 2 hours until full charge, a quick 15 minute charge provides 0 120
6006 654 7711 S Charging Type Case charges via USB-C, 20 minute quick charge provides 2 hours of playback 0 120
6005 654 0.00 7709 S Charging Type Case takes 3 hours to charge, a quick 20 minutes provides 2 hours playback 0 120
5981 654 0.00 7752 S Charging Type Charges via USB-C and Qi-Certified wireless charging pad, a quick 15 minute quick charge provides 2 hours of playback 0 120
6024 654 7755 S Charging Type Charges via USB-C, a quick 15 minute quick charge provides 3 hours of playback 0 120
6013 654 3512 S Charging Type Charges via USB-C 0 120
5998 654 0.00 7708 S Charging Type USB-C (in charging case) 0 120
6007 654 0.00 7714 S Charging Type Charges via USB-C, 2.5 hours for full charge, a quick 15 minute quick charge provides 3 hours of playback 0 120
6007 659 0.00 7715 S Connectivity Bluetooth 5.1, 3.5mm audio jack 0 152
6005 659 1702 S Connectivity Bluetooth 5.3 0 152
6006 659 7712 S Connectivity Bluetooth 5.3 with multipairing 0 152
5998 659 1702 S Connectivity Bluetooth 5.3 0 152
5981 659 0.00 7753 S Connectivity Bluetooth 5.3 with multipoint pairing, supports SBC and AAC 0 152
6013 659 0.00 7717 S Connectivity Bluetooth 5.3, USB-C Wired Audio, 2.5mm analog headphone jack 0 152
6024 659 7756 S Connectivity Bluetooth 5.4 with multipoint pairing, 2.5mm audio jack, supports SBC, AAC and aptX Adaptive 0 152
6019 659 0.00 7750 S Connectivity Bluetooth 5.4, 3.5mm/2.5mm audio jack 0 152
6007 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
6019 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
6006 671 2112 S Headphone Ear Cup Types In-Ear 0 0
6013 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
6024 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
5981 671 2112 S Headphone Ear Cup Types In-Ear 0 0
6005 671 2112 S Headphone Ear Cup Types In-Ear 0 0
5998 671 3934 S Headphone Ear Cup Types Open-Ear 0 0
6024 653 7754 S باتري Up to 30 hours with Active Noise Cancellation, 45 hours without Active Noise Cancellation 0 100
6013 653 7716 S باتري Up to 30 hours playback with Active Noise Cancellation 0 100
6019 653 7748 S باتري Up to 30 hours with Active Noise Cancellation, 24 hours with immersive audio/spatial mode, Up to 45 hours when noise cancellation is turned off 0 100
5981 653 7751 S باتري Up to 8.5 hours on a single charge, 31.5 total hours with the charging case 0 100
6007 653 7713 S باتري Up to 24 hours of playback with Active Noise Cancellation 0 100
5998 653 7707 S باتري Up to 7.5 hours of listening 0 100
6006 653 7710 S باتري Up to 6 hours of playback, charging case provides an additional 18 hours 0 100
6007 656 1560 S لون Black 0 160
5983 656 2986 S لون Sand Gold 0 160
5980 656 1560 S لون Black 0 160
6013 656 6252 S لون Plum 0 160
5998 656 1559 S لون White 0 160
6006 656 1559 S لون White 0 160
6005 656 7064 S لون Deep blue 0 160
5981 656 1560 S لون Black 0 160
6024 656 6283 S لون Off-White 0 160
6019 656 5636 S لون Black with gold accents 0 160
6024 657 7688 E ماركة Bose 0 0
6006 657 7688 E ماركة Bose 0 0
6019 657 7688 E ماركة Bose 0 0
6013 657 7688 E ماركة Bose 0 0
6007 657 7688 E ماركة Bose 0 0
6005 657 7688 E ماركة Bose 0 0
5998 657 7688 E ماركة Bose 0 0
5983 657 7688 E ماركة Bose 0 0
5981 657 7688 E ماركة Bose 0 0
5980 657 7688 E ماركة Bose 0 0