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 (
    908, 3090, 2752, 1143, 2559, 2822, 2253, 
    2751, 2255, 2927, 2729, 3140, 1542, 
    3026, 853, 1540, 1544, 2736, 4887, 2251
  ) 
  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(344, 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.00690

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "220.55"
    },
    "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": 355,
            "rows_produced_per_join": 115,
            "filtered": "32.51",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (908,3090,2752,1143,2559,2822,2253,2751,2255,2927,2729,3140,1542,3026,853,1540,1544,2736,4887,2251)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "153.22",
              "eval_cost": "11.54",
              "prefix_cost": "164.76",
              "data_read_per_join": "89K"
            },
            "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": 10,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "28.86",
              "eval_cost": "1.10",
              "prefix_cost": "205.16",
              "data_read_per_join": "4K"
            },
            "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(344,`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": 10,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.75",
              "eval_cost": "1.10",
              "prefix_cost": "209.01",
              "data_read_per_join": "25K"
            },
            "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": 10,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.75",
              "eval_cost": "1.10",
              "prefix_cost": "212.86",
              "data_read_per_join": "12K"
            },
            "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": 10,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.75",
              "eval_cost": "1.10",
              "prefix_cost": "216.71",
              "data_read_per_join": "33K"
            },
            "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": 10,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.75",
              "eval_cost": "1.10",
              "prefix_cost": "220.56",
              "data_read_per_join": "4K"
            },
            "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
853 654 1709 S Charging Type Charging via USB‑C 0 120
908 654 2457 S Charging Type USB-C and Qi wireless charging. 0 120
1143 654 1709 S Charging Type Charging via USB‑C 0 120
2251 654 1771 S Charging Type USB-C 0 120
2253 654 1771 S Charging Type USB-C 0 120
2255 654 1771 S Charging Type USB-C 0 120
2729 654 3082 S Charging Type USB‑C with full recharge in ~2 hours, and quick‑charge feature giving 2 hours playback in just 10 minutes. 0 120
2736 654 3098 S Charging Type USB-C, full charge in approximately 2 hours 0 120
2751 654 3109 S Charging Type USB-C, full charging takes about 2 hours and quick charge providing around 1 hour of playback. 0 120
2752 654 3112 S Charging Type USB-C with a full charge in about 2 hours and quick charge support. 0 120
2822 654 3236 S Charging Type Charges via USB‑C cable and also supports Qi wireless charging 0 120
2927 654 3325 S Charging Type Case charges via USB-C, earbuds in 1 hour, case 1.5 - 3 hours 0 120
3026 654 1771 S Charging Type USB-C 0 120
3090 654 3492 S Charging Type Case charges via USB-C; earbuds in 1 hour, case 2.5 hours 0 120
3140 654 3559 S Charging Type Case charges via USB-C, 10 minute quick charge provides 4 hours of playback 0 120
4887 654 6205 S Charging Type USB-C & Wireless Charging 0 120
853 659 1702 S Connectivity Bluetooth 5.3 0 152
908 659 2459 S Connectivity Bluetooth 5.2, Dual-device connectivity. 0 152
1143 659 1703 S Connectivity Bluetooth 5.0 0 152
2251 659 1702 S Connectivity Bluetooth 5.3 0 152
2253 659 1702 S Connectivity Bluetooth 5.3 0 152
2255 659 2447 S Connectivity Bluetooth 5.3, Google Fast Pair 0 152
2559 659 2975 S Connectivity Bluetooth 5.3, offering stable connections up to 10 meters 0 152
2729 659 3084 S Connectivity Bluetooth 5.2, wireless range of approximately 10 meters 0 152
2736 659 3099 S Connectivity Bluetooth 5.3, range up to 10 meters. 0 152
2751 659 3110 S Connectivity Bluetooth 5.2 with a range of up to 10 meters. 0 152
2752 659 3114 S Connectivity Bluetooth 5.2 with up to 10 meters range. 0 152
2822 659 3238 S Connectivity Bluetooth 5.3, has a range of up to 10 meters 0 152
2927 659 3326 S Connectivity Bluetooth 5.3 with a range of abour 10 meters 0 152
3026 659 3418 S Connectivity Bluetooth 5.2 0 152
3090 659 3494 S Connectivity Bluetooth 5.4 with a range of up to 10 meters 0 152
3140 659 3561 S Connectivity Bluetooth 5.3, multipoint pairing, SBC and AAC codes supported (10 meter range) 0 152
4887 659 3418 S Connectivity Bluetooth 5.2 0 152
2559 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2729 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2736 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2751 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2752 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2822 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2927 671 2112 S Headphone Ear Cup Types In-Ear 0 0
3026 671 2112 S Headphone Ear Cup Types In-Ear 0 0
3140 671 2113 S Headphone Ear Cup Types On-Ear 0 0
4887 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2736 683 3100 S Input USB-C charging port (5V/1A) 0 310
2751 683 1.00 3944 S Input 1 × USB-C 0 310
2752 683 3115 S Input USB-C charging, in-ear sensors, microphones for calls 0 310
853 658 1700 S Model Airpods 4 0 155
2736 684 3101 S Output Audio via 8mm dynamic drivers (no external output ports) 0 320
2751 684 1.00 3945 S Output 1 × USB-C 0 320
2752 684 0.00 3947 S Output JBL Pure Bass sound, 12mm drivers, clear audio playback 0 320
853 651 1638 S Processor H2 chip 0 60
1143 651 1642 S Processor H1 chip 0 60
2559 651 2973 S Processor Bluetooth 5.3 chipset 0 60
2822 651 3234 S Processor Bluetooth 5.3 chipset (SBC, AAC, LDAC) with Adaptive ANC 2.0 0 60
3026 651 3429 S Processor Kirin A2 audio SoC with digital crossover, triple adaptive EQ 0 60
4887 651 6203 S Processor Custom Marshall Audio Processor 0 60
853 646 1639 S Sensor Optical in-ear sensor 0 130
908 646 2458 S Sensor In-ear detection for automatic play/pause, Touch sensors for intuitive control, Accelerometer for spatial audio 0 130
1143 646 1640 S Sensor Optical sensor (each ear cup) 0 130
2251 646 2449 S Sensor Touch sensors for music and call control. 0 130
2253 646 2453 S Sensor Touch controls for managing media and calls. 0 130
2255 646 2446 S Sensor Touch controls for music and call functions. 0 130
2729 646 3083 S Sensor In-ear detection sensors. 0 130
2736 646 3942 S Sensor Touch controls, ANC (Active Noise Cancellation), 0 130
2751 646 3943 S Sensor Touch controls, In-ear detection, ANC (Active Noise Cancellation) 0 130
2752 646 3113 S Sensor In-ear detection sensors and touch controls. 0 130
2822 646 3237 S Sensor Includes wear detection sensors for auto-play/pause and smart controls 0 130
2927 646 3699 S Sensor Touch controls on the earbuds (customizable through the Soundcore app) 0 130
3026 646 3430 S Sensor Infrared, Hall, Gyro, Accelerometer, Bone-conduction mic, Pressure & Touch; shape-memory foam tips; head gesture controls 0 130
3090 646 3493 S Sensor Touch controls for music playback, calls, ANC, and transparency mode 0 130
3140 646 3560 S Sensor Touch sensitive controls for music, playback, volume, calls. 0 130
4887 646 6206 S Sensor Touch Control & In-Ear Detection 0 130
853 653 1704 S باتري Up to 4 hours of listening time on a single charge 0 100
908 653 2456 S باتري 60mAh (earbuds), 510mAh (charging case): Up to 6.5 hours with ANC on, up to 24.5 hours with the case. 0 100
1143 653 1708 S باتري Up to 20 hours of listening time on one charge 0 100
2251 653 2448 S باتري 54mAh (earbuds), 480mAh (charging case): Up to 10 hours on a single charge, up to 40 hours with the case. 0 100
2253 653 2452 S باتري Up to 5 hours of playback on a single charge, up to 25 hours with the case. 0 100
2255 653 2445 S باتري Up to 5.5 hours on a single charge and up to 28 hours with the charging case. 0 100
2559 653 2974 S باتري Each earbud offers up to 12 hours of play, and the included case extends that to 48 hours 0 100
2729 653 3081 S باتري 48 mAh, offering up to 8 hours of playback per charge 0 100
2736 653 3097 S باتري 600 mAh total. Battery Life is up to 36–40 hours (earbuds + case) 0 100
2751 653 3107 S باتري 40mAh per earbud, up to 7 hours of use and a charging case that extends total playback to around 28 hours. 0 100
2752 653 3111 S باتري 55mAh battery (each earbud) with up to 8 hours of use, extended to 32 hours with the 570mAh charging case. 0 100
2822 653 3235 S باتري 10 hours of listening per earbud (8 hours with ANC), 50 hours total using the charging case, 10 minutes of fast charge provides 4 hours playback 0 100
2927 653 3324 S باتري 6 hours of playback per earbud on one charge, 36 hours total with the charging case; a quick 10 minute charge provides 2 hours playback 0 100
3026 653 3410 S باتري 55mAh per earbud, 510mAh charging case 0 100
3090 653 3491 S باتري 10 hours of listening per earbud (7 hours with ANC), 45 hours total with the charging case (30 hours with ANC), 10 minutes of fast charge provides 2 hours of playback 0 100
3140 653 3558 S باتري 85mAh per earbud, 750mAh in case, 11 hours of playback, 42 hours with the charging case 0 100
4887 653 6204 S باتري Up to 5 hours (earbuds) + 20 hours (charging case) 0 100
908 656 1653 S لون Titan Grey 0 160
1143 656 1600 S لون Blue 0 160
1540 656 1912 S لون Graphite 0 160
1542 656 1559 S لون White 0 160
1544 656 1607 S لون Silver 0 160
2251 656 2441 S لون Coral Green 0 160
2253 656 1560 S لون Black 0 160
2255 656 1559 S لون White 0 160
2559 656 1560 S لون Black 0 160
2729 656 1560 S لون Black 0 160
2736 656 1560 S لون Black 0 160
2751 656 1783 S لون Dark blue 0 160
2752 656 1724 S لون Obsidian Black 0 160
2822 656 1560 S لون Black 0 160
2927 656 1560 S لون Black 0 160
3026 656 1596 S لون Green 0 160
3090 656 1560 S لون Black 0 160
3140 656 1560 S لون Black 0 160
4887 656 1560 S لون Black 0 160
853 657 1665 E ماركة Apple 0 0
908 657 1666 E ماركة Xiaomi 0 0
1143 657 1665 E ماركة Apple 0 0
1540 657 1667 E ماركة Samsung 0 0
1542 657 1667 E ماركة Samsung 0 0
1544 657 1667 E ماركة Samsung 0 0
2251 657 1666 E ماركة Xiaomi 0 0
2253 657 1666 E ماركة Xiaomi 0 0
2255 657 1666 E ماركة Xiaomi 0 0
2559 657 2082 E ماركة Anker 0 0
2729 657 3006 E ماركة JBL 0 0
2736 657 3006 E ماركة JBL 0 0
2751 657 3006 E ماركة JBL 0 0
2752 657 3006 E ماركة JBL 0 0
2822 657 2082 E ماركة Anker 0 0
2927 657 2082 E ماركة Anker 0 0
3026 657 1945 E ماركة Huawei 0 0
3090 657 2082 E ماركة Anker 0 0
3140 657 2082 E ماركة Anker 0 0
4887 657 6198 E ماركة Marshall 0 0