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 (
    3954, 3934, 3961, 4006, 3958, 3933, 4005, 
    3962, 3963, 5249, 3957, 4002, 5198
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(166, f.categories_path) 
    OR FIND_IN_SET(250, f.categories_path) 
    OR FIND_IN_SET(328, f.categories_path) 
    OR FIND_IN_SET(341, f.categories_path) 
    OR FIND_IN_SET(402, f.categories_path) 
    OR FIND_IN_SET(404, 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.00399

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "206.66"
    },
    "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": 335,
            "rows_produced_per_join": 108,
            "filtered": "32.52",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (3954,3934,3961,4006,3958,3933,4005,3962,3963,5249,3957,4002,5198)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'en')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "143.12",
              "eval_cost": "10.89",
              "prefix_cost": "154.01",
              "data_read_per_join": "84K"
            },
            "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": "27.23",
              "eval_cost": "1.04",
              "prefix_cost": "192.13",
              "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(250,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(328,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(341,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(402,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(404,`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.59",
              "eval_cost": "1.04",
              "prefix_cost": "195.77",
              "data_read_per_join": "23K"
            },
            "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.59",
              "eval_cost": "1.04",
              "prefix_cost": "199.40",
              "data_read_per_join": "11K"
            },
            "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.59",
              "eval_cost": "1.04",
              "prefix_cost": "203.03",
              "data_read_per_join": "31K"
            },
            "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.59",
              "eval_cost": "1.04",
              "prefix_cost": "206.66",
              "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
3933 667 6.00 4899 S Antenna Type 6 × external omni directional antennas. 0 260
3934 667 4.00 4902 S Antenna Type 4 × external omni-directional antennas. 0 260
3954 667 4.00 4927 S Antenna Type 4 × external high gain antennas. 0 260
3957 667 4886 S Antenna Type 4 × external omni directional antennas. 0 260
3958 667 4936 S Antenna Type Internal omni directional antennas. 0 260
3961 667 4936 S Antenna Type Internal omni directional antennas. 0 260
3962 667 4936 S Antenna Type Internal omni directional antennas. 0 260
3963 667 4936 S Antenna Type Internal omni directional antennas. 0 260
4002 667 0.00 5009 S Antenna Type Internal antennas. 0 260
4005 667 5014 S Antenna Type Internal high efficiency antennas. 0 260
4006 667 0.00 5019 S Antenna Type Internal high efficiency antennas (approx. 5 dBi @ 5 GHz, 3 dBi @ 2.4 GHz). 0 260
3933 657 5110 E Brand tp-link 0 0
3934 657 5110 E Brand tp-link 0 0
3954 657 5110 E Brand tp-link 0 0
3957 657 5110 E Brand tp-link 0 0
3958 657 5110 E Brand tp-link 0 0
3961 657 5110 E Brand tp-link 0 0
3962 657 5110 E Brand tp-link 0 0
3963 657 5110 E Brand tp-link 0 0
4002 657 5110 E Brand tp-link 0 0
4005 657 5110 E Brand tp-link 0 0
4006 657 5110 E Brand tp-link 0 0
5198 657 4743 E Brand Ubiquiti 0 0
5249 657 4743 E Brand Ubiquiti 0 0
3933 656 1560 S Color Black 0 160
3934 656 1560 S Color Black 0 160
3954 656 1560 S Color Black 0 160
3957 656 1560 S Color Black 0 160
3958 656 1559 S Color white 0 160
3961 656 1559 S Color white 0 160
3962 656 1559 S Color white 0 160
3963 656 1559 S Color white 0 160
4002 656 1559 S Color white 0 160
4005 656 1559 S Color white 0 160
4006 656 1559 S Color white 0 160
3933 664 2.40 4896 S Frequency Bands 2.4 GHz (up to 300 Mbps), 5 GHz (up to 1200+ Mbps). 0 230
3934 664 2.40 4901 S Frequency Bands 2.4 GHz (up to 600 Mbps), 5 GHz (up to 1300 Mbps). 0 230
3954 664 2.40 4925 S Frequency Bands 2.4 GHz (up to 574 Mbps), 5 GHz (up to 1201 Mbps). 0 230
3957 664 4929 S Frequency Bands 2.4 GHz (up to 574 Mbps), 5 GHz (up to 2402 Mbps). 0 230
3958 664 4883 S Frequency Bands 2.4 GHz (up to 300 Mbps), 5 GHz (up to 867 Mbps). 0 230
3961 664 4883 S Frequency Bands 2.4 GHz (up to 300 Mbps), 5 GHz (up to 867 Mbps). 0 230
3962 664 4883 S Frequency Bands 2.4 GHz (up to 300 Mbps), 5 GHz (up to 867 Mbps). 0 230
3963 664 4901 S Frequency Bands 2.4 GHz (up to 600 Mbps), 5 GHz (up to 1300 Mbps). 0 230
4002 664 2.40 5006 S Frequency Bands 2.4 GHz (up to 400 Mbps), 5 GHz (up to 867 Mbps). 0 230
4005 664 2.40 5016 S Frequency Bands 2.4 GHz (up to 574 Mbps), 5 GHz (up to 1,201 Mbps). 0 230
4006 664 4925 S Frequency Bands 2.4 GHz (up to 574 Mbps), 5 GHz (up to 1201 Mbps). 0 230
3933 669 0.00 4900 S Maximum Device Rate Up to 1500 Mbps (combined). 0 280
3934 669 0.00 4903 S Maximum Device Rate Up to 1900 Mbps (600 + 1300 Mbps). 0 280
3954 669 0.00 4928 S Maximum Device Rate Up to 1800 Mbps (574 + 1201 Mbps). 0 280
3957 669 4932 S Maximum Device Rate Up to 3000 Mbps (574 + 2402 Mbps). 0 280
3958 669 4938 S Maximum Device Rate Up to 1167 Mbps (300 + 867 Mbps). 0 280
3961 669 4938 S Maximum Device Rate Up to 1167 Mbps (300 + 867 Mbps). 0 280
3962 669 4938 S Maximum Device Rate Up to 1167 Mbps (300 + 867 Mbps). 0 280
3963 669 4903 S Maximum Device Rate Up to 1900 Mbps (600 + 1300 Mbps). 0 280
4002 669 0.00 5010 S Maximum Device Rate Up to 1,267 Mbps (400 + 867 Mbps). 0 280
4005 669 0.00 5017 S Maximum Device Rate Up to 1,775 Mbps (574 + 1,201 Mbps). 0 280
4006 669 0.00 5021 S Maximum Device Rate Up to 1775 Mbps (574 + 1201 Mbps). 0 280
5198 669 0.00 6711 S Maximum Device Rate Firewall throughput up to 3.5 Gbps; IDS/IPS throughput up to 3.5 Gbps 0 280
5249 669 3.50 6799 S Maximum Device Rate 3.5 Gbps IPS throughput 0 280
3933 668 4887 S Maximum User Capacity Up to 64 devices. 0 270
3934 668 4887 S Maximum User Capacity Up to 64 devices. 0 270
3954 668 4887 S Maximum User Capacity Up to 64 devices. 0 270
3957 668 0.00 4934 S Maximum User Capacity Up to 128 devices. 0 270
3958 668 4937 S Maximum User Capacity Up to 100 devices. 0 270
3961 668 4937 S Maximum User Capacity Up to 100 devices. 0 270
3962 668 4937 S Maximum User Capacity Up to 100 devices. 0 270
3963 668 4937 S Maximum User Capacity Up to 100 devices. 0 270
4002 668 4937 S Maximum User Capacity Up to 100 devices. 0 270
4005 668 5015 S Maximum User Capacity Up to 150 concurrent clients. 0 270
4006 668 0.00 5020 S Maximum User Capacity Up to 150 concurrent clients 0 270
5198 668 0.00 6710 S Maximum User Capacity Supports thousands of users and devices (varies by deployment size) 0 270
5249 668 0.00 6798 S Maximum User Capacity Supports over 1,000 concurrent clients 0 270
3933 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
3934 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
3954 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
3957 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
3958 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
3961 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
3962 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
3963 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
4002 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
4005 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
4006 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
5198 663 2042 S Mounting Options Rack-mountable (1U) 0 220
5249 663 0.00 6795 S Mounting Options Rackmount (1U) 0 220
3933 665 1.00 4897 S Network Ports 1 × 10/100/1000/2500 Mbps WAN, 4 × 10/100/1000 Mbps LAN. 0 240
3934 665 4884 S Network Ports 1 × 10/100/1000 Mbps WAN, 4 × 10/100/1000 Mbps LAN. 0 240
3954 665 1.00 4926 S Network Ports 1 × Gigabit WAN, 4 × Gigabit LAN. 0 240
3957 665 4926 S Network Ports 1 × Gigabit WAN, 4 × Gigabit LAN. 0 240
3958 665 4935 S Network Ports 2 × Gigabit Ethernet (RJ45). 0 240
3961 665 4935 S Network Ports 2 × Gigabit Ethernet (RJ45). 0 240
3962 665 4935 S Network Ports 2 × Gigabit Ethernet (RJ45). 0 240
3963 665 4935 S Network Ports 2 × Gigabit Ethernet (RJ45). 0 240
4002 665 2.00 5007 S Network Ports 2 × Gigabit Ethernet (RJ45) per unit. 0 240
4005 665 4935 S Network Ports 2 × Gigabit Ethernet (RJ45). 0 240
4006 665 4935 S Network Ports 2 × Gigabit Ethernet (RJ45). 0 240
5198 665 8.00 6708 S Network Ports 8 × Gigabit RJ45 LAN ports, 1 × 10G SFP+ WAN port, 1 × 10G SFP+ LAN port, 1 × Gigabit RJ45 WAN port 0 240
5249 665 1.00 6796 S Network Ports 1 × 10G SFP+ WAN, 1 × 2.5G RJ45 WAN, 8 × 1G RJ45 LAN (6 × PoE, 2 × PoE+) 0 240
3933 666 12.00 4898 S Power Support 12 V DC ⎓ 2 A. 0 250
3934 666 4893 S Power Support 12 V DC ⎓ 1 A. 0 250
3954 666 4893 S Power Support 12 V DC ⎓ 1 A. 0 250
3957 666 4930 S Power Support 12 V DC ⎓ 1.5 A. 0 250
3958 666 4930 S Power Support 12 V DC ⎓ 1.5 A. 0 250
3961 666 4930 S Power Support 12 V DC ⎓ 1.5 A. 0 250
3962 666 4930 S Power Support 12 V DC ⎓ 1.5 A. 0 250
3963 666 4898 S Power Support 12 V DC ⎓ 2 A. 0 250
4002 666 12.00 5008 S Power Support 12V/1.2A power adapter. 0 250
4005 666 5008 S Power Support 12V/1.2A power adapter. 0 250
4006 666 5008 S Power Support 12V/1.2A power adapter. 0 250
5198 666 0.00 6709 S Power Support Internal 120/240V AC power supply with standard IEC power cable 0 250
5249 666 0.00 6797 S Power Support AC Input: 100–240V, 50/60Hz; DC Input: 52V 0 250
3933 662 0.00 4895 S Wi-Fi Standard Wi‑Fi 6 (IEEE 802.11ax), dual band. 0 210
3934 662 4882 S Wi-Fi Standard Wi‑Fi 5 (IEEE 802.11a/b/g/n/ac), dual band. 0 210
3954 662 0.00 4924 S Wi-Fi Standard Wi-Fi 6 (IEEE 802.11a/b/g/n/ac/ax), dual band. 0 210
3957 662 4924 S Wi-Fi Standard Wi-Fi 6 (IEEE 802.11a/b/g/n/ac/ax), dual band. 0 210
3958 662 4890 S Wi-Fi Standard Wi-Fi 5 (IEEE 802.11a/b/g/n/ac), dual band. 0 210
3961 662 4890 S Wi-Fi Standard Wi-Fi 5 (IEEE 802.11a/b/g/n/ac), dual band. 0 210
3962 662 4890 S Wi-Fi Standard Wi-Fi 5 (IEEE 802.11a/b/g/n/ac), dual band. 0 210
3963 662 4890 S Wi-Fi Standard Wi-Fi 5 (IEEE 802.11a/b/g/n/ac), dual band. 0 210
4002 662 0.00 5005 S Wi-Fi Standard AC1300 (IEEE 802.11a/b/g/n/ac), dual band. 0 210
4005 662 4924 S Wi-Fi Standard Wi-Fi 6 (IEEE 802.11a/b/g/n/ac/ax), dual band. 0 210
4006 662 0.00 5018 S Wi-Fi Standard Wi‑Fi 6 (IEEE 802.11a/b/g/n/ac/ax), dual band. 0 210