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 (
    3998, 2117, 2115, 4041, 4030, 2118, 2116, 
    4053, 3994, 4042, 4065
  ) 
  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(352, 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.00664

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "294.20"
    },
    "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": 480,
            "rows_produced_per_join": 156,
            "filtered": "32.51",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (3998,2117,2115,4041,4030,2118,2116,4053,3994,4042,4065)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "203.15",
              "eval_cost": "15.61",
              "prefix_cost": "218.76",
              "data_read_per_join": "120K"
            },
            "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": 14,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "39.02",
              "eval_cost": "1.49",
              "prefix_cost": "273.39",
              "data_read_per_join": "6K"
            },
            "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(352,`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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.72",
              "eval_cost": "1.49",
              "prefix_cost": "278.59",
              "data_read_per_join": "33K"
            },
            "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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.72",
              "eval_cost": "1.49",
              "prefix_cost": "283.79",
              "data_read_per_join": "16K"
            },
            "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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.72",
              "eval_cost": "1.49",
              "prefix_cost": "289.00",
              "data_read_per_join": "44K"
            },
            "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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.72",
              "eval_cost": "1.49",
              "prefix_cost": "294.20",
              "data_read_per_join": "6K"
            },
            "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
2115 641 1647 S Aspect Ratio 16:9 0 30
2116 641 1647 S Aspect Ratio 16:9 0 30
2117 641 1647 S Aspect Ratio 16:9 0 30
2118 641 1647 S Aspect Ratio 16:9 0 30
3994 641 4972 S Aspect Ratio 16:10 (typical for XPS 16 0 30
3998 641 2070 S Aspect Ratio 16:10 0 30
4030 641 2070 S Aspect Ratio 16:10 0 30
4041 641 1647 S Aspect Ratio 16:9 0 30
4042 641 1647 S Aspect Ratio 16:9 0 30
4053 641 1647 S Aspect Ratio 16:9 0 30
4065 641 1647 S Aspect Ratio 16:9 0 30
3994 654 1771 S Charging Type USB-C 0 120
3998 654 5077 S Charging Type USB-C (ExpressCharge support) 0 120
4030 654 1771 S Charging Type USB-C 0 120
4041 654 5096 S Charging Type Barrel-type DC power adapter 0 120
4042 654 5096 S Charging Type Barrel-type DC power adapter 0 120
4053 654 5096 S Charging Type Barrel-type DC power adapter 0 120
4065 654 5134 S Charging Type Barrel-pin AC adapter charging 0 120
2115 659 2255 S Connectivity Wi-Fi, Bluetooth, RJ-45 Ethernet port, HDMI, USB ports 0 152
2116 659 2255 S Connectivity Wi-Fi, Bluetooth, RJ-45 Ethernet port, HDMI, USB ports 0 152
2117 659 2267 S Connectivity Wi-Fi 5, Bluetooth 0 152
2118 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
3994 659 4978 S Connectivity Wi-Fi 6/6E, Bluetooth 5.x 0 152
3998 659 4978 S Connectivity Wi-Fi 6/6E, Bluetooth 5.x 0 152
4030 659 5074 S Connectivity Wi-Fi 6E, Bluetooth 5.3, HDMI, USB ports, SD card reader 0 152
4041 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4042 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4053 659 2271 S Connectivity Wi-Fi 6, Bluetooth 5.0 0 152
4065 659 5135 S Connectivity Wi-Fi 5/6, Bluetooth 5.x 0 152
2115 649 2250 S Display 15.6" 0 20
2116 649 2250 S Display 15.6" 0 20
2117 649 2250 S Display 15.6" 0 20
2118 649 2250 S Display 15.6" 0 20
3994 649 16.30 8928 S Display 16.3" 0 20
3998 649 14.50 8927 S Display 14.5" 0 20
4041 649 2250 S Display 15.6" 0 20
4042 649 2250 S Display 15.6" 0 20
4053 649 2250 S Display 15.6" 0 20
4065 649 2250 S Display 15.6" 0 20
4030 649 2136 S Display 14" 0 20
2115 647 2254 S Front Camera 720p HD webcam 0 150
2116 647 2262 S Front Camera 720p HD webcam with dual-array mic 0 150
2117 647 2266 S Front Camera 720p HD webcam with integrated microphone 0 150
2118 647 2266 S Front Camera 720p HD webcam with integrated microphone 0 150
3994 647 4977 S Front Camera HD webcam (720p or 1080p depending on model) 0 150
3998 647 5080 S Front Camera 2.0 MP 0 150
4030 647 5080 S Front Camera 2.0 MP 0 150
4042 647 5080 S Front Camera 2.0 MP 0 150
4053 647 5114 S Front Camera 2 MP 0 150
4065 647 5137 S Front Camera 2MP 0 150
2115 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
2116 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
2117 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
2118 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
3994 652 4975 S GPU NVIDIA GeForce RTX 4050 6GB 0 80
3998 652 4992 S GPU Shared Graphics (integrated, likely Intel Iris Xe or equivalent) 0 80
4030 652 5071 S GPU Intel® UHD Graphics 0 80
4041 652 5093 S GPU ntegrated Intel UHD Graphics 0 80
4042 652 4366 S GPU Integrated Intel Iris Xe Graphics 0 80
4053 652 4366 S GPU Integrated Intel Iris Xe Graphics 0 80
4065 652 4226 S GPU Integrated Intel UHD Graphics (shared) 0 80
3994 658 5076 S Model Dell XPS 16 (9640) 0 155
3998 658 5078 S Model Dell XPS 14 (9440) 0 155
4030 658 5088 S Model Dell Inspiron 14 7440 2-in-1 Convertible Laptop 0 155
4041 658 5097 S Model Dell Vostro 3530 0 155
4042 658 5097 S Model Dell Vostro 3530 0 155
4053 658 5115 S Model Dell Inspiron 3520 0 155
4065 658 5136 S Model Dell Vostro 3520 0 155
2115 640 2257 S Operating System Windows 11 0 10
2116 640 2257 S Operating System Windows 11 0 10
2117 640 2257 S Operating System Windows 11 0 10
2118 640 2257 S Operating System Windows 11 0 10
3994 640 2257 S Operating System Windows 11 0 10
3998 640 2257 S Operating System Windows 11 0 10
4030 640 4403 S Operating System Windows 11 Home 0 10
4041 640 2257 S Operating System Windows 11 0 10
4042 640 2257 S Operating System Windows 11 0 10
4053 640 4040 S Operating System Windows 10 Pro K 0 10
4065 640 5128 S Operating System Window 10 Pro K 0 10
2115 645 2259 S Ports 2 x USB 3.2 Gen 1 Type-A, 1 x USB 2.0, 1 x HDMI 1.4, 1 x RJ-45 Ethernet port, 1 x 3.5mm Audio jack 0 110
2116 645 2259 S Ports 2 x USB 3.2 Gen 1 Type-A, 1 x USB 2.0, 1 x HDMI 1.4, 1 x RJ-45 Ethernet port, 1 x 3.5mm Audio jack 0 110
2117 645 2265 S Ports 2 x USB 3.2 Gen 1 Type-A, 1 x USB 2.0, 1 x HDMI 1.4, 1 x RJ-45 Ethernet port, 1 x 3.5mm Headphone/Microphone combo jack 0 110
2118 645 2270 S Ports 1 x USB 3.2 Gen 1 Type-C (with DisplayPort Alt Mode and Power Delivery), 2 x USB 3.2 Gen 1 Type-A, 1 x USB 2.0, 1 x HDMI 1.4, 1 x RJ-45 Ethernet port, 1 x 3.5mm Headphone/Microphone combo jack 0 110
3994 645 4976 S Ports Ports include 2 Thunderbolt 4 (USB-C) ports, 1 USB-C 3.2 Gen 2 port, a full-size SD card reader, and a 3.5mm audio jack. 0 110
3998 645 4993 S Ports 2 Thunderbolt 4 (USB-C) ports, 1 USB-C 3.2 Gen 2 port, a 3.5mm audio jack, and a full-size SD card reader 0 110
4030 645 5072 S Ports 1 × USB-C with Power Delivery & DisplayPort, 1 × USB-A 3.2 Gen 1, 1 × USB-A 2.0, 1 × HDMI 1.4, 1 × SD card reader, 1 × 3.5 mm audio jack 0 110
4041 645 5095 S Ports 1 x USB-C 3.2 Gen 1, 2 x USB-A 3.2 Gen 1, HDMI 1.4b, RJ-45 Ethernet, SD card reader, 3.5mm audio jack 0 110
4042 645 5095 S Ports 1 x USB-C 3.2 Gen 1, 2 x USB-A 3.2 Gen 1, HDMI 1.4b, RJ-45 Ethernet, SD card reader, 3.5mm audio jack 0 110
4053 645 5113 S Ports 2 x USB-A 3.2 Gen 1, 1 x USB-C 3.2 Gen 1, HDMI 1.4b, SD card reader, 3.5mm audio jack, RJ-45 Ethernet 0 110
4065 645 5133 S Ports 2 USB 3.2 Gen 1 Type-A, 1 USB 2.0 Type-A, 1 USB-C 3.2 Gen 1 (with Power Delivery & DisplayPort), HDMI 1.4, RJ-45 Ethernet port, SD card reader, and a 3.5mm audio jack 0 110
2115 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
2117 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
4030 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
4041 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
4053 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
2116 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
2118 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4042 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4065 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
3994 651 2276 S Processor Intel® Core™ Ultra 7 155H 0 60
3998 651 2276 S Processor Intel® Core™ Ultra 7 155H 0 60
2115 643 1526 S Ram 8GB 0 70
2117 643 1526 S Ram 8GB 0 70
2118 643 1526 S Ram 8GB 0 70
4030 643 1526 S Ram 8GB 0 70
4041 643 1526 S Ram 8GB 0 70
4042 643 1526 S Ram 8GB 0 70
4053 643 1526 S Ram 8GB 0 70
2116 643 1592 S Ram 16GB 0 70
3994 643 1592 S Ram 16GB 0 70
3998 643 1592 S Ram 16GB 0 70
4065 643 1592 S Ram 16GB 0 70
2115 650 1540 S Refresh Rate 120Hz 0 40
2116 650 1540 S Refresh Rate 120Hz 0 40
2117 650 1540 S Refresh Rate 120Hz 0 40
2118 650 1540 S Refresh Rate 120Hz 0 40
3994 650 1539 S Refresh Rate 60Hz 0 40
3998 650 1539 S Refresh Rate 60Hz 0 40
4030 650 1539 S Refresh Rate 60Hz 0 40
4041 650 1540 S Refresh Rate 120Hz 0 40
4042 650 1539 S Refresh Rate 60Hz 0 40
4053 650 1539 S Refresh Rate 60Hz 0 40
4065 650 1539 S Refresh Rate 60Hz 0 40
2115 642 1588 S Resolution 1920 x 1080 (full HD) 0 50
2116 642 1588 S Resolution 1920 x 1080 (full HD) 0 50
2117 642 1588 S Resolution 1920 x 1080 (full HD) 0 50
2118 642 1588 S Resolution 1920 x 1080 (full HD) 0 50
3994 642 1848 S Resolution 1920-by-1200-pixel 0 50
3998 642 1848 S Resolution 1920-by-1200-pixel 0 50
4030 642 1848 S Resolution 1920-by-1200-pixel 0 50
4041 642 5091 S Resolution 1920 x 1080 pixels 0 50
4042 642 5098 S Resolution 1920-by-1080-pixels 0 50
4053 642 5098 S Resolution 1920-by-1080-pixels 0 50
4065 642 5129 S Resolution 1920-by-1080 pixels 0 50
2115 648 1563 S التخزين 512GB 0 170
2116 648 1563 S التخزين 512GB 0 170
2117 648 1563 S التخزين 512GB 0 170
2118 648 1563 S التخزين 512GB 0 170
3998 648 1563 S التخزين 512GB 0 170
4030 648 1563 S التخزين 512GB 0 170
4041 648 1563 S التخزين 512GB 0 170
4042 648 1563 S التخزين 512GB 0 170
4053 648 1563 S التخزين 512GB 0 170
4065 648 1563 S التخزين 512GB 0 170
3994 648 1564 S التخزين 1TB 0 170
3994 653 5075 S باتري 10 to 12 hours of battery life streaming videos 0 100
3998 653 5079 S باتري Up to about 8 to 9 hours video streaming 0 100
4030 653 5087 S باتري Up to 10 hours of browsing 0 100
4041 653 5094 S باتري Around 6 to 8 hours of video streaming 0 100
4042 653 5094 S باتري Around 6 to 8 hours of video streaming 0 100
4053 653 5094 S باتري Around 6 to 8 hours of video streaming 0 100
4065 653 5132 S باتري Up to 6–8 hours of typical usage 0 100
2115 656 1746 S لون Carbon Black 0 160
2116 656 2258 S لون Nightfall Black 0 160
2117 656 1653 S لون Titan Grey 0 160
2118 656 1653 S لون Titan Grey 0 160
3994 656 4979 S لون Platinum Silver with Black Carbon Fiber palm rest 0 160
3998 656 4979 S لون Platinum Silver with Black Carbon Fiber palm rest 0 160
4041 656 1653 S لون Titan Grey 0 160
4042 656 1653 S لون Titan Grey 0 160
4053 656 1916 S لون Platinum Silver 0 160
4065 656 1746 S لون Carbon Black 0 160
4030 656 1753 S لون Ice Blue 0 160
2115 657 2249 E ماركة Dell 0 0
2116 657 2249 E ماركة Dell 0 0
2117 657 2249 E ماركة Dell 0 0
2118 657 2249 E ماركة Dell 0 0
3994 657 2249 E ماركة Dell 0 0
3998 657 2249 E ماركة Dell 0 0
4030 657 2249 E ماركة Dell 0 0
4041 657 2249 E ماركة Dell 0 0
4042 657 2249 E ماركة Dell 0 0
4053 657 2249 E ماركة Dell 0 0
4065 657 2249 E ماركة Dell 0 0