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 (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.00192

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "71.08"
    },
    "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": 115,
            "rows_produced_per_join": 37,
            "filtered": "32.52",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (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": "49.27",
              "eval_cost": "3.74",
              "prefix_cost": "53.01",
              "data_read_per_join": "28K"
            },
            "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": 3,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "9.35",
              "eval_cost": "0.36",
              "prefix_cost": "66.10",
              "data_read_per_join": "1K"
            },
            "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": 3,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.89",
              "eval_cost": "0.36",
              "prefix_cost": "67.34",
              "data_read_per_join": "8K"
            },
            "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": 3,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.89",
              "eval_cost": "0.36",
              "prefix_cost": "68.59",
              "data_read_per_join": "4K"
            },
            "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": 3,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.89",
              "eval_cost": "0.36",
              "prefix_cost": "69.84",
              "data_read_per_join": "10K"
            },
            "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": 3,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.89",
              "eval_cost": "0.36",
              "prefix_cost": "71.09",
              "data_read_per_join": "1K"
            },
            "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
4002 667 0.00 5009 S Antenna Type Internal antennas. 0 260
3963 667 4936 S Antenna Type Internal omni directional antennas. 0 260
3957 667 4886 S Antenna Type 4 × external omni directional antennas. 0 260
3957 657 5110 E Brand tp-link 0 0
5249 657 4743 E Brand Ubiquiti 0 0
5198 657 4743 E Brand Ubiquiti 0 0
4002 657 5110 E Brand tp-link 0 0
3963 657 5110 E Brand tp-link 0 0
3963 656 1559 S Color white 0 160
3957 656 1560 S Color Black 0 160
4002 656 1559 S Color white 0 160
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
3957 664 4929 S Frequency Bands 2.4 GHz (up to 574 Mbps), 5 GHz (up to 2402 Mbps). 0 230
3957 669 4932 S Maximum Device Rate Up to 3000 Mbps (574 + 2402 Mbps). 0 280
5249 669 3.50 6799 S Maximum Device Rate 3.5 Gbps IPS throughput 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
4002 669 0.00 5010 S Maximum Device Rate Up to 1,267 Mbps (400 + 867 Mbps). 0 280
3963 669 4903 S Maximum Device Rate Up to 1900 Mbps (600 + 1300 Mbps). 0 280
3963 668 4937 S Maximum User Capacity Up to 100 devices. 0 270
3957 668 0.00 4934 S Maximum User Capacity Up to 128 devices. 0 270
5249 668 0.00 6798 S Maximum User Capacity Supports over 1,000 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
4002 668 4937 S Maximum User Capacity Up to 100 devices. 0 270
4002 663 4891 S Mounting Options Tabletop placement (no wall mount). 0 220
5249 663 0.00 6795 S Mounting Options Rackmount (1U) 0 220
3957 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
5198 663 2042 S Mounting Options Rack-mountable (1U) 0 220
3957 665 4926 S Network Ports 1 × Gigabit WAN, 4 × Gigabit LAN. 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
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
4002 665 2.00 5007 S Network Ports 2 × Gigabit Ethernet (RJ45) per unit. 0 240
3963 665 4935 S Network Ports 2 × Gigabit Ethernet (RJ45). 0 240
5198 666 0.00 6709 S Power Support Internal 120/240V AC power supply with standard IEC power cable 0 250
4002 666 12.00 5008 S Power Support 12V/1.2A power adapter. 0 250
3957 666 4930 S Power Support 12 V DC ⎓ 1.5 A. 0 250
5249 666 0.00 6797 S Power Support AC Input: 100–240V, 50/60Hz; DC Input: 52V 0 250
3963 666 4898 S Power Support 12 V DC ⎓ 2 A. 0 250
3957 662 4924 S Wi-Fi Standard Wi-Fi 6 (IEEE 802.11a/b/g/n/ac/ax), 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