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 (
    4974, 5376, 5397, 4995, 5549, 4992, 4991, 
    5346, 5472, 5387, 5565, 5309, 5386, 
    5568, 5393, 4988, 5468, 5394, 5375, 
    5396, 4961, 5467, 5370
  ) 
  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(554, f.categories_path) 
    OR FIND_IN_SET(556, 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.00466

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "274.74"
    },
    "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": 443,
            "rows_produced_per_join": 144,
            "filtered": "32.51",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (4974,5376,5397,4995,5549,4992,4991,5346,5472,5387,5565,5309,5386,5568,5393,4988,5468,5394,5375,5396,4961,5467,5370)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "190.71",
              "eval_cost": "14.40",
              "prefix_cost": "205.11",
              "data_read_per_join": "111K"
            },
            "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.01",
              "eval_cost": "1.37",
              "prefix_cost": "255.52",
              "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(554,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(556,`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.43",
              "eval_cost": "1.37",
              "prefix_cost": "260.33",
              "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.43",
              "eval_cost": "1.37",
              "prefix_cost": "265.13",
              "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.43",
              "eval_cost": "1.37",
              "prefix_cost": "269.93",
              "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.43",
              "eval_cost": "1.37",
              "prefix_cost": "274.74",
              "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
5309 760 7059 S Bean Hopper Capacity N/A - Uses ground coffee or E.S.E. pods, not whole beans 0 0
5346 760 7054 S Bean Hopper Capacity 250g 0 0
5370 760 7091 S Bean Hopper Capacity 200g 0 0
5375 760 7132 S Bean Hopper Capacity 275 grams 0 0
5376 760 7143 S Bean Hopper Capacity 260 grams. 0 0
5386 760 7054 S Bean Hopper Capacity 250g 0 0
5393 760 7132 S Bean Hopper Capacity 275 grams 0 0
5394 760 7132 S Bean Hopper Capacity 275 grams 0 0
5396 760 7192 S Bean Hopper Capacity 275 grams. 0 0
5397 760 7132 S Bean Hopper Capacity 275 grams 0 0
5467 760 7245 S Bean Hopper Capacity 250 grams 0 0
5468 760 7252 S Bean Hopper Capacity 250 grams bean hopper, removable 0 0
5472 760 7276 S Bean Hopper Capacity 1500 grams 0 0
5565 760 7289 S Bean Hopper Capacity 200-250 grams 0 0
5568 760 7366 S Bean Hopper Capacity 1200 grams 0 0
4961 732 6324 S Coffee & Drink Options Espresso, Lungo, Americano, Americano XL, and milk-based recipes like cappuccino and latte macchiato using the integrated Aeroccino3 milk frother 0 0
4974 732 6325 S Coffee & Drink Options Espresso and Lungo 0 0
4988 732 6328 S Coffee & Drink Options Espresso, Lungo, Ristretto, Cappuccino, Latte Macchiato, Flat White, Caffè Latte, Hot Milk, and Hot Foam 0 0
4991 732 6325 S Coffee & Drink Options Espresso and Lungo 0 0
4992 732 6325 S Coffee & Drink Options Espresso and Lungo 0 0
4995 732 6325 S Coffee & Drink Options Espresso and Lungo 0 0
5309 732 6980 S Coffee & Drink Options Espresso, Lungo, Hot Water; Manual Milk Frothing for Cappuccinos and Lattes 0 0
5346 732 7055 S Coffee & Drink Options Espresso, Coffee, Long Coffee, Cappuccino, Latte Macchiato, Hot Water; Programmable settings for strength and volume 0 0
5370 732 7120 S Coffee & Drink Options Espresso, Coffee, Long Coffee, Cappuccino, Latte Macchiato, Hot Water; 6 one-touch specialty drinks 0 0
5375 732 7139 S Coffee & Drink Options Espresso, Ristretto, Regular coffee (up to 2 cups simultaneously) 0 0
5376 732 7144 S Coffee & Drink Options Offers four one-touch coffee drinks—Ristretto, Espresso, Long Coffee, and Americano—plus hot water for tea. 0 0
5386 732 7165 S Coffee & Drink Options Espresso, Coffee, Long Coffee, Cappuccino, Latte Macchiato, Americano, Cold Brew Coffee, Hot Water, Hot Milk; 16 one-touch specialty drinks; Customizable profiles via app connectivity 0 0
5393 732 7184 S Coffee & Drink Options 12 beverages including Espresso, Coffee, Americano, Cappuccino, Latte Macchiato, Flat White, Café au Lait, Caffé Latte, Caffé Crema, Ristretto, Espresso Lungo, Travel Mug, Frothed Milk, and Hot Water. 0 0
5394 732 7188 S Coffee & Drink Options Up to 20 hot and iced beverages, including espresso, cappuccino, latte macchiato, flat white, and iced coffee; customizable strength, volume, and milk froth 0 0
5396 732 7193 S Coffee & Drink Options Espresso, regular black coffee, espresso lungo, iced coffee, and hot water for tea. 0 0
5397 732 7197 S Coffee & Drink Options Espresso, regular black coffee, espresso lungo, cappuccino, latte macchiato, iced coffee, and hot water for tea. 0 0
5467 732 7246 S Coffee & Drink Options Espresso, latte, cappuccino, flat white (also hot water/americano style drinks) 0 0
5468 732 7253 S Coffee & Drink Options Supports 1- or 2-shot espresso, manual shot control, plus milk-based drinks like lattes, flat whites, and cappuccinos 0 0
5472 732 7278 S Coffee & Drink Options Espresso, Coffee, Long Coffee, Cappuccino, Latte Macchiato, Hot Water, Hot Chocolate, Tea; Often features dual hoppers for coffee and other ingredients 0 0
5565 732 7359 S Coffee & Drink Options Espresso, Coffee, Long Coffee, Cappuccino, Latte Macchiato, Hot Water; Programmable settings 0 0
5568 732 7368 S Coffee & Drink Options Espresso, Coffee, Long Coffee, Cappuccino, Latte, Americano, Hot Water, Hot Milk; 7 one-touch selections; 2 soluble product canisters for milk powder and chocolate 0 0
5309 757 7026 S Grinder Type & Settings N/A - This is a pump espresso machine that requires separately ground coffee or E.S.E. pods 0 0
5346 757 7056 S Grinder Type & Settings Integrated ceramic burr grinder with 13 adjustable grind settings 0 0
5370 757 7056 S Grinder Type & Settings Integrated ceramic burr grinder with 13 adjustable grind settings 0 0
5375 757 7140 S Grinder Type & Settings Metal conical burr grinder, 3 grind levels 0 0
5376 757 7145 S Grinder Type & Settings Equipped with an integrated metal conical burr grinder with adjustable fineness. 0 0
5386 757 7056 S Grinder Type & Settings Integrated ceramic burr grinder with 13 adjustable grind settings 0 0
5393 757 7185 S Grinder Type & Settings 00% ceramic burr grinder with 12 grind settings. 0 0
5394 757 7189 S Grinder Type & Settings 100% ceramic burr grinder with 12 grind settings. 0 0
5396 757 7194 S Grinder Type & Settings Built-in ceramic grinder with 5 grind settings 0 0
5397 757 7198 S Grinder Type & Settings Built-in ceramic grinder with 12 grind settings 0 0
5467 757 7247 S Grinder Type & Settings Integrated conical burr grinder with ~30 grind settings; “Tap & Go” mechanism to grind directly into portafilter 0 0
5468 757 7254 S Grinder Type & Settings Integrated conical burr grinder with 30 adjustable grind settings 0 0
5472 757 7279 S Grinder Type & Settings Integrated commercial-grade burr grinder; Adjustable grind settings and dose 0 0
5565 757 7292 S Grinder Type & Settings Integrated ceramic burr grinder; Adjustable grind settings 0 0
5568 757 7369 S Grinder Type & Settings Automatic bean grinding on demand 0 0
5309 758 7027 S Milk Frothing Manual Panarello steam wand (not automatic) 0 0
5346 758 7057 S Milk Frothing Integrated, automatic milk frother (often a side container or integrated carafe) 0 0
5370 758 7093 S Milk Frothing Integrated, automatic LatteCrema System for hands-free milk frothing 0 0
5375 758 7141 S Milk Frothing Multi-directional steam wand 0 0
5376 758 7146 S Milk Frothing Features a manual steam wand for barista-style milk frothing 0 0
5386 758 7166 S Milk Frothing Integrated, automatic Cold Milk Frother for both hot and cold milk froth 0 0
5393 758 7186 S Milk Frothing LatteGo milk system for quick and easy frothing 0 0
5394 758 7190 S Milk Frothing LatteGo milk system for fast, easy frothing and cleaning 0 0
5396 758 7195 S Milk Frothing Classic milk frother for cappuccinos and hot milk 0 0
5397 758 7199 S Milk Frothing LatteGo milk system for quick and easy frothing; can be cleaned in 10 seconds 0 0
5467 758 7248 S Milk Frothing Steam wand (cool-touch) for microfoam milk to make lattes, flat whites, cappuccinos. Includes milk jug. 0 0
5468 758 7255 S Milk Frothing Powerful steam wand capable of creating velvety microfoam milk 0 0
5472 758 7280 S Milk Frothing Automatic, integrated milk system with refrigerated milk carafe (often optional) 0 0
5565 758 7360 S Milk Frothing Manual or automatic steam wand (model dependent) 0 0
5568 758 7370 S Milk Frothing Integrated fresh milk module with chilled chamber and steam boiler for milk frothing and cup heating 0 0
5309 759 7028 S Pump Pressure 15 bar pressure 0 0
5346 759 7028 S Pump Pressure 15 bar pressure 0 0
5370 759 7028 S Pump Pressure 15 bar pressure 0 0
5375 759 7136 S Pump Pressure 15 bars 0 0
5376 759 7147 S Pump Pressure 15-bar pressure for optimal extraction. 0 0
5386 759 7028 S Pump Pressure 15 bar pressure 0 0
5393 759 7182 S Pump Pressure 15 bar 0 0
5394 759 7182 S Pump Pressure 15 bar 0 0
5396 759 7182 S Pump Pressure 15 bar 0 0
5397 759 7182 S Pump Pressure 15 bar 0 0
5467 759 7249 S Pump Pressure 15-bar Italian pump 0 0
5468 759 7256 S Pump Pressure Italian-designed 15-bar pump 0 0
5472 759 7281 S Pump Pressure 15-19 bar commercial-grade pump pressure 0 0
5565 759 7028 S Pump Pressure 15 bar pressure 0 0
5568 759 7371 S Pump Pressure 11 bar pressure 0 0
4961 734 6268 S Used Capsule Capacity Up to 12 capsules 0 0
4974 734 6326 S Used Capsule Capacity 9–11 capsules 0 0
4988 734 6329 S Used Capsule Capacity 10–14 capsules 0 0
4991 734 6326 S Used Capsule Capacity 9–11 capsules 0 0
4992 734 6333 S Used Capsule Capacity 6 used capsules 0 0
4995 734 6333 S Used Capsule Capacity 6 used capsules 0 0
4961 733 6266 S Water Tank Capacity 1 L 0 0
4974 733 6327 S Water Tank Capacity 0.7 L 0 0
4988 733 6330 S Water Tank Capacity 1.3 L 0 0
4991 733 6266 S Water Tank Capacity 1 L 0 0
4992 733 6334 S Water Tank Capacity 0.6 L 0 0
4995 733 6334 S Water Tank Capacity 0.6 L 0 0
5309 733 7029 S Water Tank Capacity Removable 1.1 liter water tank 0 0
5346 733 7058 S Water Tank Capacity Removable 1.8 liter water tank 0 0
5370 733 7058 S Water Tank Capacity Removable 1.8 liter water tank 0 0
5375 733 1.80 7142 S Water Tank Capacity 1.8 liters 0 0
5376 733 1.70 7148 S Water Tank Capacity 1.7 liters. 0 0
5386 733 7094 S Water Tank Capacity Removable 1.8 liter (60 oz) water tank 0 0
5393 733 7142 S Water Tank Capacity 1.8 liters 0 0
5394 733 7142 S Water Tank Capacity 1.8 liters 0 0
5396 733 7142 S Water Tank Capacity 1.8 liters 0 0
5397 733 7142 S Water Tank Capacity 1.8 liters 0 0
5467 733 2.80 7250 S Water Tank Capacity 2.8 L (removable reservoir) 0 0
5468 733 2.80 7257 S Water Tank Capacity 2.8 litres, removable water tank 0 0
5472 733 7282 S Water Tank Capacity 3+ Liters 0 0
5565 733 7058 S Water Tank Capacity Removable 1.8 liter water tank 0 0
5568 733 0.80 7372 S Water Tank Capacity 0.8 Liter 0 0
4961 656 1916 S لون Platinum Silver 0 160
4974 656 1607 S لون Silver 0 160
4988 656 1559 S لون White 0 160
4991 656 1560 S لون Black 0 160
4992 656 1560 S لون Black 0 160
4995 656 2315 S لون Red 0 160
5309 656 1607 S لون Silver 0 160
5346 656 1560 S لون Black 0 160
5370 656 1560 S لون Black 0 160
5375 656 1560 S لون Black 0 160
5387 656 1560 S لون Black 0 160
5393 656 0.00 7187 S لون Black with chromed accents 0 160
5394 656 0.00 7191 S لون Black and silver 0 160
5396 656 0.00 7196 S لون Black with chrome accents 0 160
5397 656 7196 S لون Black with chrome accents 0 160
5467 656 0.00 7251 S لون Stainless steel / silver finish 0 160
5468 656 0.00 7258 S لون Silver finish 0 160
5472 656 1607 S لون Silver 0 160
5549 656 1914 S لون Gray 0 160
5565 656 1560 S لون Black 0 160
5568 656 1560 S لون Black 0 160
5386 656 1761 S لون Silver Titanium 0 160
4961 657 6275 E ماركة Nespresso 0 0
4974 657 6275 E ماركة Nespresso 0 0
4988 657 6275 E ماركة Nespresso 0 0
4991 657 6275 E ماركة Nespresso 0 0
4992 657 6275 E ماركة Nespresso 0 0
4995 657 6275 E ماركة Nespresso 0 0
5309 657 6979 E ماركة De'Longhi 0 0
5346 657 6979 E ماركة De'Longhi 0 0
5370 657 6979 E ماركة De'Longhi 0 0
5375 657 7131 E ماركة Krups 0 0
5376 657 7131 E ماركة Krups 0 0
5386 657 6979 E ماركة De'Longhi 0 0
5387 657 6979 E ماركة De'Longhi 0 0
5393 657 6600 E ماركة Philips 0 0
5394 657 6600 E ماركة Philips 0 0
5396 657 6600 E ماركة Philips 0 0
5397 657 6600 E ماركة Philips 0 0
5467 657 7238 E ماركة Breville 0 0
5468 657 7238 E ماركة Breville 0 0
5472 657 7277 E ماركة Rhea 0 0
5549 657 7202 E ماركة Trisa 0 0
5565 657 7325 E ماركة Saeco 0 0
5568 657 7290 E ماركة iPilot 0 0