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 (
    2603, 2587, 2761, 2694, 2723, 2742, 2593, 
    2618, 2613, 2872, 2704, 3423, 2739, 
    2865, 2700, 2701, 2797
  ) 
  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(457, 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.00452

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "162.73"
    },
    "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": 261,
            "rows_produced_per_join": 84,
            "filtered": "32.52",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (2603,2587,2761,2694,2723,2742,2593,2618,2613,2872,2704,3423,2739,2865,2700,2701,2797)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'en')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "113.22",
              "eval_cost": "8.49",
              "prefix_cost": "121.71",
              "data_read_per_join": "65K"
            },
            "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": 8,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "21.22",
              "eval_cost": "0.81",
              "prefix_cost": "151.41",
              "data_read_per_join": "3K"
            },
            "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(457,`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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.02",
              "eval_cost": "0.81",
              "prefix_cost": "154.24",
              "data_read_per_join": "18K"
            },
            "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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.02",
              "eval_cost": "0.81",
              "prefix_cost": "157.07",
              "data_read_per_join": "9K"
            },
            "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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.02",
              "eval_cost": "0.81",
              "prefix_cost": "159.90",
              "data_read_per_join": "24K"
            },
            "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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.02",
              "eval_cost": "0.81",
              "prefix_cost": "162.73",
              "data_read_per_join": "3K"
            },
            "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
2742 653 3104 S Battery 690 mAh, with a playback time of 70 hours. 0 100
2700 653 3058 S Battery 120mAh. Up to 6 hours of continuous playback on a full charge. 0 100
2694 653 3056 S Battery 450mAh battery, providing up to 57 hours of playtime. 0 100
2701 653 4463 S Battery 85mAh 0 100
2704 653 3063 S Battery 400mAh battery providing up to 30 hours of playtime. 0 100
2723 653 3078 S Battery 500mAh, lasts up to 76 hours 0 100
2618 653 3014 S Battery 120mAh, Up to 16 hours of continuous use on a full charge, Approximately 2 hours for a full charge, 10–15 minute charge gives you around 60 minutes of playback 0 100
2739 653 3102 S Battery 500 mAh, charges fully in under 2 hours for up to 50 hours playback 0 100
2613 653 4450 S Battery Wired (no battery) 0 100
2761 653 3123 S Battery 800mAh , offering up to 27 hours of playback on a full charge. 0 100
2797 653 3156 S Battery 920mAh, up to 50h playback. 0 100
2865 653 3290 S Battery 750 mAh, up to 50 hours of playtime (40 hours with ANC on) 0 100
2872 653 3304 S Battery 610 mAh, up to 50 hours of playback 0 100
3423 653 4456 S Battery 120mAh battery, up to 16 hours playback, about 2 hours full charge, 10 minute charge for 1 hour use. 0 100
2761 657 3006 E Brand JBL 0 0
2742 657 3006 E Brand JBL 0 0
2587 657 3006 E Brand JBL 0 0
2739 657 3006 E Brand JBL 0 0
2797 657 3006 E Brand JBL 0 0
2723 657 3006 E Brand JBL 0 0
2865 657 3006 E Brand JBL 0 0
2704 657 3006 E Brand JBL 0 0
2701 657 3006 E Brand JBL 0 0
2872 657 3006 E Brand JBL 0 0
2700 657 3006 E Brand JBL 0 0
3423 657 3006 E Brand JBL 0 0
2694 657 3006 E Brand JBL 0 0
2603 657 3006 E Brand JBL 0 0
2613 657 3006 E Brand JBL 0 0
2593 657 3006 E Brand JBL 0 0
2618 657 3006 E Brand JBL 0 0
2618 654 3636 S Charging Type USB-C fast charging. 0 120
2761 654 3124 S Charging Type USB-C, taking about 2 hours for a full charge that provides up to 27 hours of playback. 0 120
2797 654 3157 S Charging Type USB-C, full charge in about 2 hours, 10 minute quick charge gives 5 hours playback. 0 120
2613 654 4451 S Charging Type Wired, does not require charging. 0 120
2742 654 3105 S Charging Type USB-C in about 2 hours, with a 5-minute quick charge providing up to 3 hours of playback. 0 120
2739 654 1771 S Charging Type USB-C 0 120
2865 654 3291 S Charging Type USB-C, quick charge, 10 minutes gives about 4 hours of playback 0 120
2723 654 3079 S Charging Type USB-C. A full charge takes approximately 2 hours, and a quick 5-minute charge provides an additional 3 hours of playback. 0 120
2872 654 3305 S Charging Type USB-C fast charging , 5 min charge has a 3 hour playback 0 120
2704 654 3064 S Charging Type USB-C fast charging (5 min charge = 2 hrs playback, full charge in 2 hrs) 0 120
2700 654 3059 S Charging Type Micro USB 0 120
2694 654 3057 S Charging Type USB-C, supports quick charging. 5 minutes of charge gives about 3 hours of playback. 0 120
2701 654 3062 S Charging Type Micro USB cable ,approximately 2 hours for full charge 0 120
3423 654 3636 S Charging Type USB-C fast charging. 0 120
2593 656 2315 S Color Red 0 160
2694 656 1560 S Color Black 0 160
2797 656 1560 S Color Black 0 160
2700 656 1560 S Color Black 0 160
2742 656 1560 S Color Black 0 160
2613 656 1600 S Color Blue 0 160
2603 656 1600 S Color Blue 0 160
2587 656 1560 S Color Black 0 160
2739 656 1600 S Color Blue 0 160
3423 656 1559 S Color white 0 160
2865 656 1560 S Color Black 0 160
2723 656 1560 S Color Black 0 160
2701 656 1559 S Color white 0 160
2618 656 1560 S Color Black 0 160
2704 656 2315 S Color Red 0 160
2872 656 1560 S Color Black 0 160
2761 656 1558 S Color Pink 0 160
2593 659 4579 S Connectivity USB-C wired connection. 0 152
2797 659 1702 S Connectivity Bluetooth 5.3 0 152
2865 659 3292 S Connectivity Bluetooth 5.0, multipoint connection 0 152
2694 659 1702 S Connectivity Bluetooth 5.3 0 152
2872 659 3306 S Connectivity Bluetooth 5.0, 3.5mm Audio Jack 0 152
3423 659 1703 S Connectivity Bluetooth 5.0 0 152
2761 659 3125 S Connectivity Bluetooth 5.0, up to 10 meters wireless range. 0 152
2700 659 3060 S Connectivity Bluetooth 4.1 0 152
2742 659 3106 S Connectivity Bluetooth 5.3, also includes a 3.5 mm wired audio option. 0 152
2739 659 3103 S Connectivity Bluetooth 5.3, plus a 3.5 mm wired option 0 152
2613 659 4452 S Connectivity Wired with 3.5mm audio jack 0 152
2723 659 3080 S Connectivity Bluetooth 5.3 and 3.5mm audio jack (wired). 0 152
2618 659 3015 S Connectivity Bluetooth 0 152
2603 659 4578 S Connectivity Wired USB-C connection. 0 152
2701 659 3015 S Connectivity Bluetooth 0 152
2704 659 3069 S Connectivity Bluetooth 5.0 with a range of up to 15 meters 0 152
2865 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
3423 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2694 671 2113 S Headphone Ear Cup Types On-Ear 0 0
2700 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2618 671 2113 S Headphone Ear Cup Types On-Ear 0 0
2587 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2872 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
2701 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2704 671 2113 S Headphone Ear Cup Types On-Ear 0 0
2613 671 2113 S Headphone Ear Cup Types On-Ear 0 0
2723 671 2113 S Headphone Ear Cup Types On-Ear 0 0
2593 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2797 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
2739 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
2742 671 2111 S Headphone Ear Cup Types Over-Ear 0 0
2603 671 2112 S Headphone Ear Cup Types In-Ear 0 0
2761 671 2111 S Headphone Ear Cup Types Over-Ear 0 0