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 (
    5290, 5271, 5277, 5287, 5281, 5270, 5278, 
    5272, 5276, 5285, 5265, 5288, 5263, 
    5289, 5266, 5262, 5282, 5275, 5264, 
    5283, 5268, 5274, 5273
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(250, f.categories_path) 
    OR FIND_IN_SET(372, f.categories_path) 
    OR FIND_IN_SET(552, f.categories_path) 
    OR FIND_IN_SET(553, f.categories_path) 
    OR FIND_IN_SET(555, f.categories_path) 
    OR FIND_IN_SET(557, f.categories_path) 
    OR FIND_IN_SET(561, f.categories_path) 
    OR FIND_IN_SET(563, 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.00469

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "237.09"
    },
    "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": 381,
            "rows_produced_per_join": 123,
            "filtered": "32.51",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (5290,5271,5277,5287,5281,5270,5278,5272,5276,5285,5265,5288,5263,5289,5266,5262,5282,5275,5264,5283,5268,5274,5273)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "164.82",
              "eval_cost": "12.39",
              "prefix_cost": "177.21",
              "data_read_per_join": "95K"
            },
            "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": 11,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "30.97",
              "eval_cost": "1.18",
              "prefix_cost": "220.57",
              "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(250,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(372,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(552,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(553,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(555,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(557,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(561,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(563,`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": 11,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.95",
              "eval_cost": "1.18",
              "prefix_cost": "224.70",
              "data_read_per_join": "26K"
            },
            "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": 11,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.95",
              "eval_cost": "1.18",
              "prefix_cost": "228.83",
              "data_read_per_join": "13K"
            },
            "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": 11,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.95",
              "eval_cost": "1.18",
              "prefix_cost": "232.96",
              "data_read_per_join": "35K"
            },
            "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": 11,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.95",
              "eval_cost": "1.18",
              "prefix_cost": "237.09",
              "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
5262 741 6864 S Aromatic Notes Dark Chocolate, Roasted Nuts, Spices 0 0
5263 741 6871 S Aromatic Notes Spicy, Peppery 0 0
5264 741 6873 S Aromatic Notes Caramel, Roasted Chestnuts, Dark Red Fruits 0 0
5265 741 6877 S Aromatic Notes Toasted Black Currant 0 0
5266 741 6881 S Aromatic Notes Red Berries, Pink Berry Pepper 0 0
5268 741 6888 S Aromatic Notes Fruity, Smooth 0 0
5270 741 6893 S Aromatic Notes Fruity, Mild 0 0
5271 741 6897 S Aromatic Notes Black Cherry, Roasted 0 0
5272 741 6899 S Aromatic Notes Roasted Almonds, Pecans 0 0
5273 741 6902 S Aromatic Notes Velvety, Smooth 0 0
5274 741 6905 S Aromatic Notes Toasted Cereal, Caramel 0 0
5275 741 6908 S Aromatic Notes Roasted Almonds, Toasted Cereal 0 0
5276 741 6911 S Aromatic Notes Toasted Almonds, Roasted Cereal 0 0
5277 741 6913 S Aromatic Notes Hot Milk, Caramel Flavour, Smooth Coffee 0 0
5278 741 6916 S Aromatic Notes Rich, Bold Espresso, Milk Froth 0 0
5281 741 6923 S Aromatic Notes Milk, Cocoa, Mild Coffee 0 0
5282 741 6926 S Aromatic Notes Green Tea, Mint, Light Sweetness 0 0
5283 741 6929 S Aromatic Notes Rich Espresso, Steamed Milk, Silky Foam 0 0
5285 741 6933 S Aromatic Notes Caramel, Cream, Mild Coffee 0 0
5287 741 6939 S Aromatic Notes Milk, Smooth Coffee, Mild Sweetness 0 0
5288 741 6942 S Aromatic Notes White Chocolate, Sweet Milk, Smooth Coffee 0 0
5289 741 6944 S Aromatic Notes Caramel, Toasted, Soft Spice 0 0
5290 741 6947 S Aromatic Notes Nutty, Floral 0 0
5262 742 6865 S Aromatic Profile Intense, Full-bodied, Strong Espresso 0 0
5263 742 6872 S Aromatic Profile Intense, Full-bodied, Bold Espresso 0 0
5264 742 6874 S Aromatic Profile Bold, Syrupy, Velvety Crema 0 0
5265 742 6878 S Aromatic Profile Full-bodied, Velvety Texture 0 0
5266 742 6882 S Aromatic Profile Spicy, Fruity, Full-bodied 0 0
5268 742 6885 S Aromatic Profile Balanced, Aromatic 0 0
5270 742 6894 S Aromatic Profile Balanced, Smooth 0 0
5271 742 6891 S Aromatic Profile Bold, Full-Bodied 0 0
5272 742 6900 S Aromatic Profile Balanced, Nutty 0 0
5273 742 6903 S Aromatic Profile Balanced, Indulgent 0 0
5274 742 6906 S Aromatic Profile Balanced, Round 0 0
5275 742 6909 S Aromatic Profile Bold, Velvety 0 0
5276 742 6912 S Aromatic Profile Balanced, Creamy 0 0
5277 742 6914 S Aromatic Profile Milkier than Cappuccino, indulgent and layered 0 0
5278 742 6917 S Aromatic Profile Creamy, Balanced, Frothy Coffee Drink 0 0
5281 742 6924 S Aromatic Profile Creamy, Indulgent, Café-Style Mocha 0 0
5282 742 6927 S Aromatic Profile Refreshing, Herbal, Mildly Sweet 0 0
5283 742 6930 S Aromatic Profile Creamy, Balanced, Indulgent 0 0
5285 742 6934 S Aromatic Profile Sweet, Layered, Indulgent 0 0
5287 742 6940 S Aromatic Profile Creamy, Balanced Latte Drink 0 0
5288 742 6943 S Aromatic Profile Indulgent, Creamy, Dessert-Style 0 0
5289 742 6945 S Aromatic Profile Bold, Dark Roast, Full-Bodied 0 0
5290 742 6948 S Aromatic Profile Balanced, Juicy, Smooth 0 0
5262 743 6866 S Cup Size Espresso (30 ml) / Ristretto (25 ml) 0 0
5263 743 6866 S Cup Size Espresso (30 ml) / Ristretto (25 ml) 0 0
5264 743 6875 S Cup Size Ristretto (25 ml) 0 0
5265 743 6879 S Cup Size Espresso (30 ml) 0 0
5266 743 6879 S Cup Size Espresso (30 ml) 0 0
5268 743 6889 S Cup Size Lungo (120 ml) 0 0
5270 743 6895 S Cup Size Grande (180–230 ml) 0 0
5271 743 6895 S Cup Size Grande (180–230 ml) 0 0
5272 743 6901 S Cup Size Espresso (30 ml) / Cortado (80 ml) 0 0
5273 743 6904 S Cup Size Flat White (180 ml) 0 0
5274 743 6907 S Cup Size Medium (180 ml) 0 0
5275 743 6910 S Cup Size Large (200 ml) 0 0
5276 743 6910 S Cup Size Large (200 ml) 0 0
5277 743 6915 S Cup Size Large (220 ml) 0 0
5278 743 6915 S Cup Size Large (220 ml) 0 0
5281 743 6915 S Cup Size Large (220 ml) 0 0
5282 743 6928 S Cup Size Medium (150 ml) 0 0
5283 743 6915 S Cup Size Large (220 ml) 0 0
5285 743 6910 S Cup Size Large (200 ml) 0 0
5287 743 6910 S Cup Size Large (200 ml) 0 0
5288 743 6910 S Cup Size Large (200 ml) 0 0
5289 743 6879 S Cup Size Espresso (30 ml) 0 0
5290 743 6879 S Cup Size Espresso (30 ml) 0 0
5262 740 6870 S Intensity 13/13 0 0
5263 740 6867 S Intensity 11/13 0 0
5264 740 6876 S Intensity 9/11 0 0
5265 740 6880 S Intensity 8/13 0 0
5266 740 6883 S Intensity 7/11 0 0
5268 740 6887 S Intensity 6/11 0 0
5270 740 6896 S Intensity 5/11 0 0
5271 740 6898 S Intensity 8/11 0 0
5272 740 6887 S Intensity 6/11 0 0
5273 740 6896 S Intensity 5/11 0 0
5274 740 6883 S Intensity 7/11 0 0
5275 740 6876 S Intensity 9/11 0 0
5276 740 6887 S Intensity 6/11 0 0
5277 740 6896 S Intensity 5/11 0 0
5278 740 6883 S Intensity 7/11 0 0
5281 740 6925 S Intensity 11/11 0 0
5282 740 6896 S Intensity 5/11 0 0
5283 740 6887 S Intensity 6/11 0 0
5285 740 6896 S Intensity 5/11 0 0
5287 740 6941 S Intensity 4/11 0 0
5288 740 6896 S Intensity 5/11 0 0
5289 740 6946 S Intensity 11/12 0 0
5290 740 6883 S Intensity 7/11 0 0
5262 656 1674 S لون Brown 0 160
5263 656 1609 S لون Purple 0 160
5264 656 2077 S لون Grey 0 160
5265 656 2315 S لون Red 0 160
5266 656 1560 S لون Black 0 160
5268 656 1707 S لون Orange 0 160
5270 656 1595 S لون Yellow 0 160
5271 656 1707 S لون Orange 0 160
5272 656 3421 S لون Beige 0 160
5273 656 2308 S لون Turquoise 0 160
5274 656 1674 S لون Brown 0 160
5275 656 1674 S لون Brown 0 160
5276 656 1707 S لون Orange 0 160
5277 656 1674 S لون Brown 0 160
5278 656 1596 S لون Green 0 160
5281 656 1609 S لون Purple 0 160
5282 656 1596 S لون Green 0 160
5283 656 1674 S لون Brown 0 160
5285 656 2758 S لون Gold 0 160
5287 656 1674 S لون Brown 0 160
5288 656 3421 S لون Beige 0 160
5289 656 1674 S لون Brown 0 160
5290 656 1674 S لون Brown 0 160
5262 657 6868 E ماركة Nescafé 0 0
5263 657 6868 E ماركة Nescafé 0 0
5264 657 6868 E ماركة Nescafé 0 0
5265 657 6868 E ماركة Nescafé 0 0
5266 657 6868 E ماركة Nescafé 0 0
5268 657 6868 E ماركة Nescafé 0 0
5270 657 6868 E ماركة Nescafé 0 0
5271 657 6868 E ماركة Nescafé 0 0
5272 657 6868 E ماركة Nescafé 0 0
5273 657 6868 E ماركة Nescafé 0 0
5274 657 6868 E ماركة Nescafé 0 0
5275 657 6868 E ماركة Nescafé 0 0
5276 657 6868 E ماركة Nescafé 0 0
5277 657 6868 E ماركة Nescafé 0 0
5278 657 6868 E ماركة Nescafé 0 0
5281 657 6868 E ماركة Nescafé 0 0
5282 657 6868 E ماركة Nescafé 0 0
5283 657 6868 E ماركة Nescafé 0 0
5285 657 6868 E ماركة Nescafé 0 0
5287 657 6868 E ماركة Nescafé 0 0
5288 657 6868 E ماركة Nescafé 0 0
5289 657 6868 E ماركة Nescafé 0 0
5290 657 6868 E ماركة Nescafé 0 0