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 = 'en' 
  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 = 'en' 
  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 (
    2478, 2527, 2490, 2471, 2576, 2620, 2502, 
    2473, 2565, 2580
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(166, f.categories_path) 
    OR FIND_IN_SET(234, f.categories_path) 
    OR FIND_IN_SET(236, 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 = 'en' 
ORDER BY 
  fd.description, 
  fv.position

Query time 0.00588

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "270.88"
    },
    "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": 442,
            "rows_produced_per_join": 143,
            "filtered": "32.52",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (2478,2527,2490,2471,2576,2620,2502,2473,2565,2580)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'en')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "187.04",
              "eval_cost": "14.37",
              "prefix_cost": "201.41",
              "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": "35.93",
              "eval_cost": "1.37",
              "prefix_cost": "251.71",
              "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(166,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(234,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(236,`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.42",
              "eval_cost": "1.37",
              "prefix_cost": "256.50",
              "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.42",
              "eval_cost": "1.37",
              "prefix_cost": "261.30",
              "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.42",
              "eval_cost": "1.37",
              "prefix_cost": "266.09",
              "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.42",
              "eval_cost": "1.37",
              "prefix_cost": "270.88",
              "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
2471 641 1648 S Aspect Ratio 20:9 0 30
2473 641 1648 S Aspect Ratio 20:9 0 30
2478 641 1648 S Aspect Ratio 20:9 0 30
2490 641 1648 S Aspect Ratio 20:9 0 30
2502 641 1648 S Aspect Ratio 20:9 0 30
2527 641 2936 S Aspect Ratio 20.5:9 0 30
2565 641 1648 S Aspect Ratio 20:9 0 30
2576 641 1648 S Aspect Ratio 20:9 0 30
2580 641 1648 S Aspect Ratio 20:9 0 30
2620 641 3017 S Aspect Ratio 20.6:9 0 30
2471 653 1568 S Battery 5,410mAh 0 100
2473 653 2902 S Battery 5,240mAh 0 100
2478 653 2906 S Battery 5,000mAh 0 100
2490 653 2107 S Battery 5,000 mAh 0 100
2502 653 2906 S Battery 5,000mAh 0 100
2527 653 2940 S Battery 5,200 mAh 0 100
2565 653 2906 S Battery 5,000mAh 0 100
2576 653 1567 S Battery 5,110mAh 0 100
2580 653 3003 S Battery 5,300mAh 0 100
2620 653 2906 S Battery 5,000mAh 0 100
2471 657 1666 E Brand Xiaomi 0 0
2473 657 1666 E Brand Xiaomi 0 0
2478 657 1666 E Brand Xiaomi 0 0
2490 657 1666 E Brand Xiaomi 0 0
2502 657 1666 E Brand Xiaomi 0 0
2527 657 1666 E Brand Xiaomi 0 0
2565 657 1666 E Brand Xiaomi 0 0
2576 657 1666 E Brand Xiaomi 0 0
2580 657 1666 E Brand Xiaomi 0 0
2620 657 1666 E Brand Xiaomi 0 0
2471 656 1641 S Color Silver Chrome 0 160
2473 656 2903 S Color Liquid Silver 0 160
2478 656 1653 S Color Titan Grey 0 160
2490 656 2910 S Color Lemon Green 0 160
2502 656 1559 S Color white 0 160
2527 656 1600 S Color Blue 0 160
2565 656 2985 S Color Aurora Purple 0 160
2576 656 1596 S Color Green 0 160
2580 656 1560 S Color Black 0 160
2620 656 1559 S Color white 0 160
2471 649 2896 S Display 6.73" 0 20
2473 649 2901 S Display 6.36" 0 20
2478 649 1536 S Display 6.67" 0 20
2490 649 1536 S Display 6.67" 0 20
2502 649 2896 S Display 6.73" 0 20
2527 649 2935 S Display 6.88" 0 20
2565 649 1536 S Display 6.67" 0 20
2576 649 1536 S Display 6.67" 0 20
2580 649 1536 S Display 6.67" 0 20
2620 649 3016 S Display 6.71" 0 20
2471 647 1573 S Front Camera 20MP 0 150
2473 647 1574 S Front Camera 32MP 0 150
2478 647 1574 S Front Camera 32MP 0 150
2490 647 1574 S Front Camera 32MP 0 150
2502 647 1574 S Front Camera 32MP 0 150
2527 647 1804 S Front Camera 13MP 0 150
2565 647 2952 S Front Camera 16MB 0 150
2576 647 1573 S Front Camera 20MP 0 150
2580 647 1574 S Front Camera 32MP 0 150
2620 647 1854 S Front Camera 5MP 0 150
2471 652 1817 S GPU Adreno 740 0 80
2473 652 1827 S GPU Adreno 830 0 80
2478 652 2905 S GPU ARM Immortalis-G720 MC12 0 80
2490 652 2913 S GPU ARM Mali-G610 MC6 0 80
2502 652 2916 S GPU Qualcomm Adreno 0 80
2527 652 2939 S GPU Mali-G57 MP1 0 80
2565 652 2949 S GPU Mali‑G57 MC2 0 80
2576 652 2999 S GPU IMG BXM‑8‑256 0 80
2580 652 1827 S GPU Adreno 830 0 80
2620 652 3020 S GPU PowerVR GE8320 0 80
2471 640 1620 S Operating System HyperOS 2 0 10
2473 640 1620 S Operating System HyperOS 2 0 10
2478 640 1629 S Operating System HyperOS 0 10
2490 640 1629 S Operating System HyperOS 0 10
2502 640 1629 S Operating System HyperOS 0 10
2527 640 1629 S Operating System HyperOS 0 10
2565 640 1629 S Operating System HyperOS 0 10
2576 640 1629 S Operating System HyperOS 0 10
2580 640 1620 S Operating System HyperOS 2 0 10
2620 640 1794 S Operating System Android 14 0 10
2471 645 2898 S Ports 1 x USB Type-C 0 110
2473 645 2898 S Ports 1 x USB Type-C 0 110
2478 645 2898 S Ports 1 x USB Type-C 0 110
2490 645 2898 S Ports 1 x USB Type-C 0 110
2502 645 2918 S Ports 1 x USB‑C 3.2 Gen 2 with DP & OTG 0 110
2527 645 2941 S Ports 1 x USB‑C, 3.5 mm headphone jack, infrared blaster 0 110
2565 645 2951 S Ports 1 x USB‑C; 3.5 mm headphone jack; Infrared blaster 0 110
2576 645 3001 S Ports 1 x USB‑C, 1 x 3.5 mm headphone jack, 1 x Stereo speakers, 1 x Infrared blaster 0 110
2580 645 3004 S Ports 1 x USB‑C (PD 3.0, QC 3+), 1 x IR blaster 0 110
2620 645 3021 S Ports 1 x USB‑C 2.0, 1 x 3.5 mm headphone jack 0 110
2471 651 1550 S Processor Snapdragon 8 Elite Mobile Platform 0 60
2473 651 1550 S Processor Snapdragon 8 Elite Mobile Platform 0 60
2478 651 1865 S Processor MediaTek Dimensity 9300+ 0 60
2490 651 2912 S Processor MediaTek Dimensity 8300 0 60
2502 651 1551 S Processor Snapdragon 8 Gen 3 0 60
2527 651 2938 S Processor Unisoc T7250 0 60
2565 651 2948 S Processor MediaTek Helio G99‑Ultra 0 60
2576 651 2998 S Processor MediaTek Dimensity 7025 Ultra 0 60
2580 651 1826 S Processor Snapdragon 8 Elite 0 60
2620 651 3019 S Processor MediaTek Helio G36 0 60
2527 643 2870 S Ram 3GB 0 70
2620 643 1684 S Ram 4GB 0 70
2565 643 1526 S Ram 8GB 0 70
2473 643 1587 S Ram 12GB 0 70
2478 643 1587 S Ram 12GB 0 70
2490 643 1587 S Ram 12GB 0 70
2576 643 1587 S Ram 12GB 0 70
2471 643 1592 S Ram 16GB 0 70
2502 643 1592 S Ram 16GB 0 70
2580 643 1592 S Ram 16GB 0 70
2471 655 2899 S Rear Camera 200MP 0 140
2473 655 1582 S Rear Camera 50MP 0 140
2478 655 1582 S Rear Camera 50MP 0 140
2490 655 1582 S Rear Camera 50MP 0 140
2502 655 1582 S Rear Camera 50MP 0 140
2527 655 2942 S Rear Camera 108MB 0 140
2565 655 2899 S Rear Camera 200MP 0 140
2576 655 1582 S Rear Camera 50MP 0 140
2580 655 1582 S Rear Camera 50MP 0 140
2620 655 1853 S Rear Camera 8MP 0 140
2471 650 1540 S Refresh Rate 120Hz 0 40
2473 650 1540 S Refresh Rate 120Hz 0 40
2478 650 1541 S Refresh Rate 144Hz 0 40
2490 650 1541 S Refresh Rate 144Hz 0 40
2502 650 1540 S Refresh Rate 120Hz 0 40
2527 650 1540 S Refresh Rate 120Hz 0 40
2565 650 1540 S Refresh Rate 120Hz 0 40
2576 650 1540 S Refresh Rate 120Hz 0 40
2580 650 1540 S Refresh Rate 120Hz 0 40
2620 650 1847 S Refresh Rate 90Hz 0 40
2471 642 2897 S Resolution 3200 x 1440 0 50
2473 642 2920 S Resolution 2670 x 1200 0 50
2478 642 2904 S Resolution 2712 x 1220 0 50
2490 642 2911 S Resolution 2712 × 1220 0 50
2502 642 2917 S Resolution 3200×1440 0 50
2527 642 2937 S Resolution 1640 x 720 0 50
2565 642 2947 S Resolution 2400 x 1080 0 50
2576 642 2947 S Resolution 2400 x 1080 0 50
2580 642 2917 S Resolution 3200×1440 0 50
2620 642 3018 S Resolution 1650 x 720 0 50
2471 644 1798 S SIM Dual Nano-SIM 0 90
2473 644 1798 S SIM Dual Nano-SIM 0 90
2478 644 1798 S SIM Dual Nano-SIM 0 90
2490 644 1798 S SIM Dual Nano-SIM 0 90
2502 644 1798 S SIM Dual Nano-SIM 0 90
2527 644 1798 S SIM Dual Nano-SIM 0 90
2565 644 2950 S SIM Dual Nano-Sim with Hybrid Slot 0 90
2576 644 3000 S SIM Dual Nano‑SIM or Nano + micro‑SD 0 90
2580 644 1798 S SIM Dual Nano-SIM 0 90
2620 644 2950 S SIM Dual Nano-Sim with Hybrid Slot 0 90
2527 648 1687 S Storage 64GB 0 170
2620 648 1561 S Storage 128GB 0 170
2565 648 1562 S Storage 256GB 0 170
2576 648 1562 S Storage 256GB 0 170
2471 648 1563 S Storage 512GB 0 170
2473 648 1563 S Storage 512GB 0 170
2490 648 1563 S Storage 512GB 0 170
2502 648 1563 S Storage 512GB 0 170
2580 648 1563 S Storage 512GB 0 170
2478 648 1564 S Storage 1TB 0 170