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 (
    3754, 1930, 4022, 3974, 3883, 3776, 3980
  ) 
  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(356, 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.00446

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "132.30"
    },
    "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": 215,
            "rows_produced_per_join": 69,
            "filtered": "32.52",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (3754,1930,4022,3974,3883,3776,3980)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'en')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "91.52",
              "eval_cost": "6.99",
              "prefix_cost": "98.51",
              "data_read_per_join": "54K"
            },
            "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": 6,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "17.48",
              "eval_cost": "0.67",
              "prefix_cost": "122.98",
              "data_read_per_join": "2K"
            },
            "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(356,`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": 6,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.67",
              "eval_cost": "0.67",
              "prefix_cost": "125.31",
              "data_read_per_join": "15K"
            },
            "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": 6,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.67",
              "eval_cost": "0.67",
              "prefix_cost": "127.64",
              "data_read_per_join": "7K"
            },
            "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": 6,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.67",
              "eval_cost": "0.67",
              "prefix_cost": "129.97",
              "data_read_per_join": "20K"
            },
            "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": 6,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.67",
              "eval_cost": "0.67",
              "prefix_cost": "132.30",
              "data_read_per_join": "2K"
            },
            "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
3883 653 4942 S Battery Up to 22 hours video streaming (M4 Pro), up to 18 hours video streaming (M4 Max) 0 100
3776 653 4943 S Battery Up to 18 hours video streaming 0 100
3974 653 4946 S Battery Up to 24 hours video streaming (M4 Pro), up to 21 hours video streaming (M4 Max) 0 100
1930 653 4939 S Battery Up to 24 hours video streaming 0 100
3754 653 4943 S Battery Up to 18 hours video streaming 0 100
4022 657 1665 E Brand Apple 0 0
3883 657 1665 E Brand Apple 0 0
3776 657 1665 E Brand Apple 0 0
3754 657 1665 E Brand Apple 0 0
3974 657 1665 E Brand Apple 0 0
1930 657 1665 E Brand Apple 0 0
3980 657 1665 E Brand Apple 0 0
3883 654 4940 S Charging Type 70W USB-C Power Adapter 0 120
1930 654 4940 S Charging Type 70W USB-C Power Adapter 0 120
3754 654 4945 S Charging Type 30W USB-C Power Adapter 0 120
3776 654 4944 S Charging Type 35W Dual USB-C Port Compact Power Adapter 0 120
3974 654 4948 S Charging Type 140W USB-C Power Adapter 0 120
3980 656 1600 S Color Blue 0 160
3883 656 1560 S Color Black 0 160
4022 656 1607 S Color silver 0 160
1930 656 1560 S Color Black 0 160
3974 656 1607 S Color silver 0 160
3754 656 1599 S Color Midnight Black 0 160
3776 656 1610 S Color Starlight 0 160
3980 659 2175 S Connectivity Wi-Fi 6E and Bluetooth 5.3 0 152
3776 649 2115 S Display 15" 0 20
3754 649 1570 S Display 13" 0 20
3980 649 1938 S Display 24" 0 20
3883 649 2136 S Display 14" 0 20
1930 649 2136 S Display 14" 0 20
3974 649 2137 S Display 16" 0 20
3776 647 1546 S Front Camera 12MP 0 150
3974 647 1546 S Front Camera 12MP 0 150
1930 647 1546 S Front Camera 12MP 0 150
3754 647 1546 S Front Camera 12MP 0 150
3980 647 1546 S Front Camera 12MP 0 150
3883 647 1546 S Front Camera 12MP 0 150
3754 658 4733 S Model M4 chip with 10-core CPU and 8-core GPU, 16GB, 256GB SSD 0 155
3776 658 4737 S Model M4 chip with 10-core CPU and 10-core GPU, 16GB, 256GB SSD 0 155
1930 658 4765 S Model 10-core CPU and 10-core GPU, 16GB, 512GB SSD 0 155
3883 658 4839 S Model M4 Pro (12-core CPU and 16-core GPU), 24GB, 512GB SSD 0 155
4022 658 4839 S Model M4 Pro (12-core CPU and 16-core GPU), 24GB, 512GB SSD 0 155
3974 658 4852 S Model M4 Pro (14-core CPU and 20-core GPU), 24GB, 512GB SSD 0 155
3980 658 4949 S Model 10-core CPU and 10-core GPU, 16GB, 256GB SSD 0 155
3980 640 2141 S Operating System MacOS 0 10
1930 640 2141 S Operating System MacOS 0 10
4022 640 2141 S Operating System MacOS 0 10
3754 640 2141 S Operating System MacOS 0 10
3776 640 2141 S Operating System MacOS 0 10
3883 640 2141 S Operating System MacOS 0 10
3974 640 2141 S Operating System MacOS 0 10
3974 645 4947 S Ports 3x Three Thunderbolt 5 (USB-C) ports, 1x HDMI port, 1x SDXC card slot 0 110
1930 645 2143 S Ports Three Thunderbolt 4 (USB-C) ports, 1 x HDMI port, SDXC card slot, MagSafe 3 charging port, 3.5 mm headphone jack 0 110
4022 645 5066 S Ports 3x Thunderbolt 5 ports, 2x USB-C ports, 1x HDMI port, 1x Gigabit Ethernet 0 110
3883 645 4851 S Ports 3× Thunderbolt 5 (USB‑C) ports, 1× HDMI, (supports up to 8K resolution), 1× SDXC card slot, 1× 3.5 mm headphone, 1× MagSafe 3 charging port 0 110
3754 645 4736 S Ports 2 × Thunderbolt 4 (USB-C) ports, MagSafe 3 charging port 0 110
3980 645 4951 S Ports 4x Thunderbolt ports, 1x Gigabit Ethernet 0 110
3776 645 4736 S Ports 2 × Thunderbolt 4 (USB-C) ports, MagSafe 3 charging port 0 110
3754 651 1583 S Processor M4 chip 0 60
3776 651 1583 S Processor M4 chip 0 60
3883 651 4941 S Processor M4 Pro, M4 Max chip 0 60
4022 651 1583 S Processor M4 chip 0 60
3974 651 4941 S Processor M4 Pro, M4 Max chip 0 60
1930 651 1583 S Processor M4 chip 0 60
3980 651 1583 S Processor M4 chip 0 60
3883 650 1540 S Refresh Rate 120Hz 0 40
3776 650 1540 S Refresh Rate 120Hz 0 40
1930 650 1540 S Refresh Rate 120Hz 0 40
3974 650 1540 S Refresh Rate 120Hz 0 40
3980 650 1539 S Refresh Rate 60Hz 0 40
3754 650 1540 S Refresh Rate 120Hz 0 40
3883 642 2140 S Resolution 3024-by-1964-pixels 0 50
3754 642 2120 S Resolution 2560-by-1664-pixels 0 50
3776 642 4738 S Resolution 2880-by-1864-pixel 0 50
3980 642 2172 S Resolution 4480-by-2520-pixels 0 50
3974 642 2163 S Resolution 3456-by-2234-pixel 0 50
1930 642 2140 S Resolution 3024-by-1964-pixels 0 50
3980 648 1562 S Storage 256GB 0 170