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 (
    4216, 4221, 4011, 4171, 4169, 4175, 4220, 
    4199, 4082, 4200, 4214
  ) 
  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(353, 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.00835

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "278.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": "idx_product_feature_variant_id",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 454,
            "rows_produced_per_join": 147,
            "filtered": "32.51",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (4216,4221,4011,4171,4169,4175,4220,4199,4082,4200,4214)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "192.30",
              "eval_cost": "14.76",
              "prefix_cost": "207.06",
              "data_read_per_join": "114K"
            },
            "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": "36.90",
              "eval_cost": "1.41",
              "prefix_cost": "258.73",
              "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(353,`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.52",
              "eval_cost": "1.41",
              "prefix_cost": "263.65",
              "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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.52",
              "eval_cost": "1.41",
              "prefix_cost": "268.57",
              "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.52",
              "eval_cost": "1.41",
              "prefix_cost": "273.49",
              "data_read_per_join": "42K"
            },
            "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.52",
              "eval_cost": "1.41",
              "prefix_cost": "278.42",
              "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
4011 641 4968 S Aspect Ratio 16:9. 0 30
4082 641 5049 S Aspect Ratio 16:10. 0 30
4169 641 1647 S Aspect Ratio 16:9 0 30
4171 641 2070 S Aspect Ratio 16:10 0 30
4175 641 2070 S Aspect Ratio 16:10 0 30
4199 641 2070 S Aspect Ratio 16:10 0 30
4200 641 2070 S Aspect Ratio 16:10 0 30
4214 641 2070 S Aspect Ratio 16:10 0 30
4216 641 2070 S Aspect Ratio 16:10 0 30
4220 641 1647 S Aspect Ratio 16:9 0 30
4221 641 1655 S Aspect Ratio 3:2 0 30
4011 659 5043 S Connectivity Wi-Fi 6, Bluetooth 5.3. 0 152
4082 659 5057 S Connectivity Wi-Fi 6E, Bluetooth 5.2. 0 152
4169 659 4047 S Connectivity Wi-Fi 6E, Bluetooth 5.2 0 152
4171 659 4047 S Connectivity Wi-Fi 6E, Bluetooth 5.2 0 152
4175 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4199 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4200 659 4071 S Connectivity Wi-Fi 6, Bluetooth 5.2 0 152
4214 659 4047 S Connectivity Wi-Fi 6E, Bluetooth 5.2 0 152
4216 659 4047 S Connectivity Wi-Fi 6E, Bluetooth 5.2 0 152
4220 659 4047 S Connectivity Wi-Fi 6E, Bluetooth 5.2 0 152
4221 659 4047 S Connectivity Wi-Fi 6E, Bluetooth 5.2 0 152
4011 649 2250 S Display 15.6" 0 20
4169 649 5237 S Display 16.1" 0 20
4220 649 17.30 8929 S Display 17.3" 0 20
4221 649 2555 S Display 13.5" 0 20
4199 649 2136 S Display 14" 0 20
4082 649 2137 S Display 16" 0 20
4171 649 2137 S Display 16" 0 20
4175 649 2137 S Display 16" 0 20
4200 649 2137 S Display 16" 0 20
4214 649 2137 S Display 16" 0 20
4216 649 2137 S Display 16" 0 20
4011 647 5042 S Front Camera 720p HD webcam. 0 150
4082 647 5056 S Front Camera 1080p FHD webcam with privacy shutter. 0 150
4169 647 4184 S Front Camera 1080p FHD webcam with privacy shutter 0 150
4171 647 4184 S Front Camera 1080p FHD webcam with privacy shutter 0 150
4175 647 2254 S Front Camera 720p HD webcam 0 150
4199 647 4184 S Front Camera 1080p FHD webcam with privacy shutter 0 150
4200 647 5317 S Front Camera 1080p FHD webcam 0 150
4214 647 4184 S Front Camera 1080p FHD webcam with privacy shutter 0 150
4216 647 4184 S Front Camera 1080p FHD webcam with privacy shutter 0 150
4220 647 4184 S Front Camera 1080p FHD webcam with privacy shutter 0 150
4221 647 4184 S Front Camera 1080p FHD webcam with privacy shutter 0 150
4011 652 5039 S GPU Intel® UHD Graphics (Shared). 0 80
4082 652 5053 S GPU Intel® Iris® Xe Graphics. 0 80
4169 652 5240 S GPU NVIDIA® GeForce RTX™ 0 80
4171 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
4175 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
4199 652 5313 S GPU Shared Graphics 0 80
4200 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
4214 652 5345 S GPU NVIDIA GeForce MX570 4GB 0 80
4216 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
4220 652 5361 S GPU NVIDIA RTX 3050 4GB 0 80
4221 652 2253 S GPU Intel® Iris® Xe Graphics 0 80
4011 640 5033 S Operating System Windows 11 Pro K. 0 10
4082 640 5033 S Operating System Windows 11 Pro K. 0 10
4169 640 4049 S Operating System Windows 11 Pro K 0 10
4171 640 4049 S Operating System Windows 11 Pro K 0 10
4175 640 2257 S Operating System Windows 11 0 10
4199 640 2257 S Operating System Windows 11 0 10
4200 640 2257 S Operating System Windows 11 0 10
4214 640 4049 S Operating System Windows 11 Pro K 0 10
4216 640 2274 S Operating System Windows 11 Pro 0 10
4220 640 4403 S Operating System Windows 11 Home 0 10
4221 640 2274 S Operating System Windows 11 Pro 0 10
4011 645 5041 S Ports 2 × USB-A 3.2 Gen 1, 1 × USB-C, 1 × HDMI 1.4b, 1 × RJ-45 Ethernet port, 1 × 3.5 mm combo audio jack, 1 × Power connector. 0 110
4082 645 5055 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort 1.4 & Power Delivery), 1 × USB-C 3.2 Gen 1, 3 × USB-A 3.2 Gen 1, 1 × HDMI 2.1 (supports 4K @ 120 Hz / 8K @ 60 Hz), 1 × RJ-45 Ethernet port (2.5 GbE), 1 × 3.5 mm combo audio jack, 1 × Power connector. 0 110
4169 645 5236 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort 1.4 & Power Delivery), 1 × USB-C 3.2 Gen 1, 3 × USB-A 3.2 Gen 1, 1 × HDMI 2.1 (supports 4K @ 120 Hz / 8K @ 60 Hz), 1 × RJ-45 Ethernet port (2.5 GbE), 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4171 645 5236 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort 1.4 & Power Delivery), 1 × USB-C 3.2 Gen 1, 3 × USB-A 3.2 Gen 1, 1 × HDMI 2.1 (supports 4K @ 120 Hz / 8K @ 60 Hz), 1 × RJ-45 Ethernet port (2.5 GbE), 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4175 645 5250 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort 1.4 & Power Delivery), 1 × USB-C 3.2 Gen 1, 2 × USB-A 3.2 Gen 1, 1 × HDMI 2.0, 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4199 645 5315 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort & Power Delivery), 2 × USB-A 3.2 Gen 1, 1 × HDMI 2.1, 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4200 645 5316 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort 1.4 & Power Delivery), 1 × USB-C 3.2 Gen 1, 2 × USB-A 3.2 Gen 1, 1 × HDMI 2.1, 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4214 645 5236 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort 1.4 & Power Delivery), 1 × USB-C 3.2 Gen 1, 3 × USB-A 3.2 Gen 1, 1 × HDMI 2.1 (supports 4K @ 120 Hz / 8K @ 60 Hz), 1 × RJ-45 Ethernet port (2.5 GbE), 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4216 645 5236 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort 1.4 & Power Delivery), 1 × USB-C 3.2 Gen 1, 3 × USB-A 3.2 Gen 1, 1 × HDMI 2.1 (supports 4K @ 120 Hz / 8K @ 60 Hz), 1 × RJ-45 Ethernet port (2.5 GbE), 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4220 645 5363 S Ports 1 × USB-C 3.2 Gen 2 (with DisplayPort 1.4 & Power Delivery), 2 × USB-A 3.2 Gen 1, 1 × HDMI 2.1 (supports 4K @ 120 Hz), 1 × RJ-45 Ethernet port, 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4221 645 5369 S Ports 2 × Thunderbolt 4 / USB4 Type-C (with Power Delivery), 1 × USB-A 3.2 Gen 2, 1 × 3.5 mm combo audio jack, 1 × Power connector 0 110
4011 651 4140 S Processor Intel Core i3-1315U 0 60
4169 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
4221 651 2854 S Processor 12th Gen Intel® Core™ i7‑1265U (Intel® Evo™ platform) 0 60
4082 651 5911 S Processor Intel® Core™ Ultra 5 125H (1.2–4.5GHz, 14 cores) 0 60
4175 651 5911 S Processor Intel® Core™ Ultra 5 125H (1.2–4.5GHz, 14 cores) 0 60
4200 651 5911 S Processor Intel® Core™ Ultra 5 125H (1.2–4.5GHz, 14 cores) 0 60
4171 651 2276 S Processor Intel® Core™ Ultra 7 155H 0 60
4214 651 2276 S Processor Intel® Core™ Ultra 7 155H 0 60
4216 651 2276 S Processor Intel® Core™ Ultra 7 155H 0 60
4220 651 2276 S Processor Intel® Core™ Ultra 7 155H 0 60
4199 651 5700 S Processor AMD Ryzen 7 7435HS (8 cores, 16 threads, up to 4.55GHz) 0 60
4011 643 1526 S Ram 8GB 0 70
4175 643 1526 S Ram 8GB 0 70
4200 643 1526 S Ram 8GB 0 70
4082 643 1592 S Ram 16GB 0 70
4169 643 1592 S Ram 16GB 0 70
4171 643 1592 S Ram 16GB 0 70
4199 643 1592 S Ram 16GB 0 70
4216 643 1592 S Ram 16GB 0 70
4221 643 1592 S Ram 16GB 0 70
4214 643 2117 S Ram 32GB 0 70
4220 643 2117 S Ram 32GB 0 70
4011 650 5035 S Refresh Rate 60Hz. 0 40
4082 650 5035 S Refresh Rate 60Hz. 0 40
4169 650 1541 S Refresh Rate 144Hz 0 40
4171 650 1539 S Refresh Rate 60Hz 0 40
4175 650 1539 S Refresh Rate 60Hz 0 40
4199 650 1539 S Refresh Rate 60Hz 0 40
4200 650 1539 S Refresh Rate 60Hz 0 40
4214 650 1539 S Refresh Rate 60Hz 0 40
4216 650 1539 S Refresh Rate 60Hz 0 40
4220 650 1539 S Refresh Rate 60Hz 0 40
4221 650 1539 S Refresh Rate 60Hz 0 40
4011 642 5036 S Resolution 1920 × 1080. 0 50
4082 642 5141 S Resolution 1920 x 1200. 0 50
4169 642 4211 S Resolution 1920 x 1080 0 50
4171 642 2275 S Resolution 1920 x 1200 0 50
4175 642 2275 S Resolution 1920 x 1200 0 50
4199 642 2275 S Resolution 1920 x 1200 0 50
4200 642 2275 S Resolution 1920 x 1200 0 50
4214 642 2275 S Resolution 1920 x 1200 0 50
4216 642 2275 S Resolution 1920 x 1200 0 50
4220 642 4211 S Resolution 1920 x 1080 0 50
4221 642 5365 S Resolution 2256 x 1504 0 50
4011 648 1563 S التخزين 512GB 0 170
4082 648 1563 S التخزين 512GB 0 170
4169 648 1563 S التخزين 512GB 0 170
4171 648 1563 S التخزين 512GB 0 170
4175 648 1563 S التخزين 512GB 0 170
4216 648 1563 S التخزين 512GB 0 170
4221 648 1563 S التخزين 512GB 0 170
4199 648 1564 S التخزين 1TB 0 170
4200 648 1564 S التخزين 1TB 0 170
4214 648 1564 S التخزين 1TB 0 170
4220 648 1564 S التخزين 1TB 0 170
4011 653 5040 S باتري Up to 8 hours. 0 100
4082 653 5054 S باتري 41Wh to 53Wh, Up to 11 hours. 0 100
4169 653 5241 S باتري 41 Wh, up to 7 hours 0 100
4171 653 5247 S باتري 41Wh, Up to 11 hours 0 100
4175 653 5253 S باتري 43Wh, Up to 10 hours 0 100
4199 653 5314 S باتري 55Wh, Up to 10 hours 0 100
4200 653 5247 S باتري 41Wh, Up to 11 hours 0 100
4214 653 5247 S باتري 41Wh, Up to 11 hours 0 100
4216 653 5247 S باتري 41Wh, Up to 11 hours 0 100
4220 653 5362 S باتري 56Wh, Up to 10 hours 0 100
4221 653 5368 S باتري 56Wh, Up to 12 hours 0 100
4011 656 1607 S لون Silver 0 160
4082 656 2077 S لون Grey 0 160
4169 656 1783 S لون Dark blue 0 160
4171 656 1607 S لون Silver 0 160
4175 656 1607 S لون Silver 0 160
4199 656 1607 S لون Silver 0 160
4200 656 1607 S لون Silver 0 160
4214 656 2077 S لون Grey 0 160
4216 656 2077 S لون Grey 0 160
4220 656 1607 S لون Silver 0 160
4221 656 1889 S لون Dark Gray 0 160
4011 657 4960 E ماركة HP 0 0
4082 657 4960 E ماركة HP 0 0
4169 657 4960 E ماركة HP 0 0
4171 657 4960 E ماركة HP 0 0
4175 657 4960 E ماركة HP 0 0
4199 657 4960 E ماركة HP 0 0
4200 657 4960 E ماركة HP 0 0
4214 657 4960 E ماركة HP 0 0
4216 657 4960 E ماركة HP 0 0
4220 657 4960 E ماركة HP 0 0
4221 657 4960 E ماركة HP 0 0