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 (5035, 5040, 5042, 6085, 6016, 6084) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(521, f.categories_path) 
    OR FIND_IN_SET(522, f.categories_path) 
    OR FIND_IN_SET(537, 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.00447

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "130.23"
    },
    "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": "product_id",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 212,
            "rows_produced_per_join": 68,
            "filtered": "32.52",
            "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (5035,5040,5042,6085,6016,6084))",
            "cost_info": {
              "read_cost": "90.02",
              "eval_cost": "6.89",
              "prefix_cost": "96.91",
              "data_read_per_join": "53K"
            },
            "used_columns": [
              "feature_id",
              "product_id",
              "variant_id",
              "value",
              "value_int",
              "lang_code"
            ],
            "attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'en') and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))"
          }
        },
        {
          "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.23",
              "eval_cost": "0.66",
              "prefix_cost": "121.04",
              "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(521,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(522,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(537,`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.64",
              "eval_cost": "0.66",
              "prefix_cost": "123.34",
              "data_read_per_join": "14K"
            },
            "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.64",
              "eval_cost": "0.66",
              "prefix_cost": "125.63",
              "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.64",
              "eval_cost": "0.66",
              "prefix_cost": "127.93",
              "data_read_per_join": "19K"
            },
            "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.64",
              "eval_cost": "0.66",
              "prefix_cost": "130.23",
              "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
6084 657 6402 E Brand Ezviz 0 0
5035 657 6404 E Brand Holowits 0 0
6085 657 6402 E Brand Ezviz 0 0
6016 657 6402 E Brand Ezviz 0 0
5040 657 6404 E Brand Holowits 0 0
5042 657 6404 E Brand Holowits 0 0
6085 745 7784 S Camera Connectivity Wi-Fi (IEEE 802.11b/g/n) 0 0
6084 745 7774 S Camera Connectivity Wi-Fi (802.11 b/g/n/ax, 2.4 GHz) 0 0
5035 745 6420 S Camera Connectivity Wired (Ethernet, PoE) 0 0
6016 745 7718 S Camera Connectivity Dual-band WiFi 6 (2.4 / 5 GHz) 0 0
5040 745 6420 S Camera Connectivity Wired (Ethernet, PoE) 0 0
5042 745 6420 S Camera Connectivity Wired (Ethernet, PoE) 0 0
6085 744 7785 S Camera Type Outdoor wireless battery pan & tilt camera 0 0
5040 744 6453 S Camera Type PTZ Dome (Outdoor) 0 0
5042 744 6453 S Camera Type PTZ Dome (Outdoor) 0 0
6084 744 7775 S Camera Type Outdoor wireless pan & tilt (PT) battery camera 0 0
6016 744 7719 S Camera Type Indoor PT (Pan/Tilt) / smart video calling camera 0 0
5035 744 6453 S Camera Type PTZ Dome (Outdoor) 0 0
5042 656 1559 S Color white 0 160
6016 656 1560 S Color Black 0 160
6085 656 1559 S Color white 0 160
5035 656 1559 S Color white 0 160
5040 656 1559 S Color white 0 160
6085 735 7786 S Field of View (FOV) Pan 340°, Tilt 65° 0 0
6016 735 7720 S Field of View (FOV) About 100° diagonal view angle 0 0
5035 735 6454 S Field of View (FOV) 102° (wide) / 28° (tele) 0 0
6084 735 7776 S Field of View (FOV) Pan 340°, Tilt 75° 0 0
5042 735 6470 S Field of View (FOV) 63° (wide) / 4.1° (tele) 0 0
5040 735 6467 S Field of View (FOV) 62° (wide) / 3.1° (tele) 0 0
6085 736 7787 S Focal Length 4 mm, F1.6 0 0
5042 736 6471 S Focal Length 4.5mm–67.5mm motorized 0 0
5040 736 6468 S Focal Length 5.8mm–145mm motorized 0 0
5035 736 6455 S Focal Length 4.8mm–144mm motorized 0 0
6084 736 7777 S Focal Length 4 mm, F1.2 0 0
6016 736 7721 S Focal Length 4 mm lens, f/1.6 0 0
6085 737 7788 S Night Mode IR night vision up to 15 m + built-in spotlights (color mode) 0 0
5042 737 6424 S Night Mode Supported; automatic (ICR), color, B/W, scheduled 0 0
5035 737 6424 S Night Mode Supported; automatic (ICR), color, B/W, scheduled 0 0
6084 737 7778 S Night Mode IR (black & white) + color night vision via built-in spotlights, up to ~15 m 0 0
5040 737 6424 S Night Mode Supported; automatic (ICR), color, B/W, scheduled 0 0
6016 737 7722 S Night Mode IR night vision up to ~10 meters 0 0
6084 738 7779 S Operating Conditions –20 °C to +50 °C, humidity ≤ 95% non-condensing 0 0
5035 738 6336 S Operating Conditions -40 °C to 60 °C 0 0
6016 738 7723 S Operating Conditions –10 °C to 40 °C 0 0
5040 738 6336 S Operating Conditions -40 °C to 60 °C 0 0
5042 738 6336 S Operating Conditions -40 °C to 60 °C 0 0
6085 738 7779 S Operating Conditions –20 °C to +50 °C, humidity ≤ 95% non-condensing 0 0
6085 645 0.00 7790 S Ports DC 5 V / 2 A 0 110
5035 645 6426 S Ports 1×RJ-45, 1×DC 0 110
6084 645 0.00 7781 S Ports DC 5 V / 2 A power input 0 110
6016 645 0.00 7725 S Ports USB Type-C (for power) 0 110
5042 645 6426 S Ports 1×RJ-45, 1×DC 0 110
5040 645 6426 S Ports 1×RJ-45, 1×DC 0 110
5035 642 6438 S Resolution 5MP (2880×1620) 0 50
6085 642 7789 S Resolution 2304 × 1296 (3 MP / “2K”) 0 50
6016 642 7724 S Resolution 4 MP (2K+ quality) 0 50
5042 642 6472 S Resolution 2MP (1920×1080) 0 50
6084 642 7780 S Resolution 3840 × 2160 (4K) 0 50
5040 642 6469 S Resolution 4MP (2560×1440) 0 50
5042 646 6457 S Sensor AI detection (person, vehicle, object) 0 130
6085 646 0.00 7791 S Sensor Smart human motion detection (PIR + algorithm) 0 130
5035 646 6456 S Sensor AI detection (person, vehicle, object), intercom 0 130
5040 646 6457 S Sensor AI detection (person, vehicle, object) 0 130
6084 646 0.00 7782 S Sensor AI-powered human shape detection, auto-tracking 0 130
6016 646 0.00 7726 S Sensor CMOS image sensor (4 MP) 0 130
5040 648 6418 S Storage microSD card slot (up to 256 GB), NAS, cloud 0 170
5042 648 6418 S Storage microSD card slot (up to 256 GB), NAS, cloud 0 170
5035 648 6418 S Storage microSD card slot (up to 256 GB), NAS, cloud 0 170
6084 648 0.00 7783 S Storage microSD (up to 512 GB) + support for EZVIZ Cloud storage 0 170
6016 648 0.00 7727 S Storage microSD card support up to 512 GB + optional EZVIZ CloudPlay storage 0 170
6085 648 0.00 7792 S Storage microSD card up to 256 GB + EZVIZ CloudPlay support 0 170