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 (
    5034, 5043, 5044, 5502, 5050, 5049, 6017, 
    5333, 5594, 6191, 5363, 6018, 6185
  ) 
  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(536, 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.00590

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "286.81"
    },
    "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": 467,
            "rows_produced_per_join": 151,
            "filtered": "32.52",
            "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (5034,5043,5044,5502,5050,5049,6017,5333,5594,6191,5363,6018,6185))",
            "cost_info": {
              "read_cost": "198.23",
              "eval_cost": "15.18",
              "prefix_cost": "213.41",
              "data_read_per_join": "117K"
            },
            "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": 14,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "37.96",
              "eval_cost": "1.45",
              "prefix_cost": "266.56",
              "data_read_per_join": "6K"
            },
            "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(536,`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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.62",
              "eval_cost": "1.45",
              "prefix_cost": "271.62",
              "data_read_per_join": "32K"
            },
            "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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.62",
              "eval_cost": "1.45",
              "prefix_cost": "276.68",
              "data_read_per_join": "16K"
            },
            "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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.62",
              "eval_cost": "1.45",
              "prefix_cost": "281.75",
              "data_read_per_join": "43K"
            },
            "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": 14,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.62",
              "eval_cost": "1.45",
              "prefix_cost": "286.81",
              "data_read_per_join": "6K"
            },
            "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
5034 657 6404 E Brand Holowits 0 0
5043 657 6404 E Brand Holowits 0 0
5044 657 6404 E Brand Holowits 0 0
5049 657 6404 E Brand Holowits 0 0
5050 657 6404 E Brand Holowits 0 0
5333 657 6403 E Brand Hikvision 0 0
5363 657 6403 E Brand Hikvision 0 0
5502 657 6403 E Brand Hikvision 0 0
5594 657 6403 E Brand Hikvision 0 0
6017 657 6402 E Brand Ezviz 0 0
6018 657 6402 E Brand Ezviz 0 0
6185 657 6403 E Brand Hikvision 0 0
6191 657 6402 E Brand Ezviz 0 0
5034 745 6420 S Camera Connectivity Wired (Ethernet, PoE) 0 0
5043 745 6420 S Camera Connectivity Wired (Ethernet, PoE) 0 0
5044 745 6420 S Camera Connectivity Wired (Ethernet, PoE) 0 0
5049 745 6420 S Camera Connectivity Wired (Ethernet, PoE) 0 0
5050 745 6420 S Camera Connectivity Wired (Ethernet, PoE) 0 0
5333 745 7031 S Camera Connectivity Wired / Analog 4-in-1 (TVI / AHD / CVI / CVBS) 0 0
5363 745 7031 S Camera Connectivity Wired / Analog 4-in-1 (TVI / AHD / CVI / CVBS) 0 0
5502 745 7304 S Camera Connectivity Wired / Analog HD (TVI) output 0 0
5594 745 7315 S Camera Connectivity Wired / Ethernet (RJ-45), PoE (IEEE802.3af) 0 0
6017 745 7728 S Camera Connectivity Wi-Fi (IEEE 802.11 b/g/n), 2.4 GHz only 0 0
6018 745 7738 S Camera Connectivity Wi-Fi (2.4 GHz, IEEE 802.11b/g/n) 0 0
6185 745 7430 S Camera Connectivity Network (PoE or 12 VDC) 0 0
6191 745 7851 S Camera Connectivity Wi-Fi 2.4 GHz (IEEE 802.11b/g/n 0 0
5034 744 6421 S Camera Type Bullet (Outdoor) 0 0
5043 744 6473 S Camera Type Fixed Dome (Indoor/Outdoor) 0 0
5044 744 6473 S Camera Type Fixed Dome (Indoor/Outdoor) 0 0
5049 744 6473 S Camera Type Fixed Dome (Indoor/Outdoor) 0 0
5050 744 6473 S Camera Type Fixed Dome (Indoor/Outdoor) 0 0
5333 744 7032 S Camera Type Indoor Fixed Turret Camera 0 0
5363 744 7032 S Camera Type Indoor Fixed Turret Camera 0 0
5502 744 7305 S Camera Type Fixed PT Turret Camera 0 0
5594 744 7406 S Camera Type Fixed Turret Network Camera 0 0
6017 744 7729 S Camera Type Indoor battery-powered fixed camera 0 0
6018 744 7739 S Camera Type Indoor battery-powered fixed / palm-sized camera (with magnetic base) 0 0
6185 744 7439 S Camera Type Fixed Dome Network Camera 0 0
6191 744 7852 S Camera Type Indoor plug-in fixed home security camera 0 0
5034 656 1559 S Color white 0 160
5043 656 1559 S Color white 0 160
5044 656 1559 S Color white 0 160
5049 656 1559 S Color white 0 160
5050 656 1559 S Color white 0 160
5333 656 1559 S Color white 0 160
5363 656 1559 S Color white 0 160
5502 656 1559 S Color white 0 160
5594 656 1559 S Color white 0 160
6017 656 0.00 1559 S Color white 0 160
6018 656 1560 S Color Black 0 160
6185 656 1559 S Color white 0 160
6191 656 1559 S Color white 0 160
5034 735 6528 S Field of View (FOV) 79.2° 0 0
5043 735 6474 S Field of View (FOV) 102° 0 0
5044 735 6481 S Field of View (FOV) 87° 0 0
5049 735 6503 S Field of View (FOV) 85° 0 0
5050 735 6502 S Field of View (FOV) 105° 0 0
5333 735 7021 S Field of View (FOV) 2.8 mm, horizontal FOV: 101°, vertical FOV: 60°, diagonal FOV: 122° 0 0
5363 735 7037 S Field of View (FOV) 2.8 mm, horizontal FOV: 96.5°, vertical FOV: 48.9°, diagonal FOV: 120.5° 0 0
5502 735 7297 S Field of View (FOV) 2.8 mm, horizontal FOV: 105°, vertical FOV: 62°, diagonal FOV: 131°; 0 0
5594 735 7407 S Field of View (FOV) 2.8 mm, horizontal FOV 115°, vertical FOV 60°, diagonal FOV 143° 0 0
6017 735 7730 S Field of View (FOV) 113° diagonal, ~90° horizontal, ~50° vertical 0 0
6018 735 7740 S Field of View (FOV) ~100° diagonal, ~85° horizontal, ~46° vertical 0 0
6185 735 7828 S Field of View (FOV) 2.8 mm, horizontal FOV 106°, vertical FOV 56°, diagonal FOV 129° 0 0
6191 735 7853 S Field of View (FOV) 108° diagonal, 91° horizontal, 50° vertical wide-angle lens 0 0
5034 736 6482 S Focal Length 3.6mm fixed 0 0
5043 736 6452 S Focal Length 2.8mm fixed 0 0
5044 736 6482 S Focal Length 3.6mm fixed 0 0
5049 736 6482 S Focal Length 3.6mm fixed 0 0
5050 736 6452 S Focal Length 2.8mm fixed 0 0
5333 736 7030 S Focal Length 2.8 mm / 3.6 mm 0 0
5363 736 7030 S Focal Length 2.8 mm / 3.6 mm 0 0
5502 736 7030 S Focal Length 2.8 mm / 3.6 mm 0 0
5594 736 7408 S Focal Length 2.8 mm / 4 mm 0 0
6017 736 7731 S Focal Length 2.8 mm, f/2.2 0 0
6018 736 7741 S Focal Length 4 mm @ f/1.6 0 0
6185 736 7408 S Focal Length 2.8 mm / 4 mm 0 0
6191 736 7854 S Focal Length ~2.8 mm lens, IR-cut auto filter 0 0
5034 737 6437 S Night Mode Full-color with double light; automatic (ICR), color, B/W, scheduled 0 0
5043 737 6424 S Night Mode Supported; automatic (ICR), color, B/W, scheduled 0 0
5044 737 6424 S Night Mode Supported; automatic (ICR), color, B/W, scheduled 0 0
5049 737 6424 S Night Mode Supported; automatic (ICR), color, B/W, scheduled 0 0
5050 737 6424 S Night Mode Supported; automatic (ICR), color, B/W, scheduled 0 0
5333 737 7033 S Night Mode Smart IR up to 20 m 0 0
5363 737 7078 S Night Mode EXIR up to 20 m 0 0
5502 737 7306 S Night Mode IR up to 25 m; White Light up to 20 m with Smart-Hybrid Light 0 0
5594 737 7409 S Night Mode Smart Hybrid Light (IR + white LED) up to 30 meters 0 0
6017 737 7732 S Night Mode Up to 5 meters using IR illumination 0 0
6018 737 7742 S Night Mode IR night vision up to ~5 meters 0 0
6185 737 0.00 7829 S Night Mode Smart Hybrid Light (IR & Warm Light) 0 0
6191 737 7855 S Night Mode IR night vision up to 10 meters with auto IR-cut filter 0 0
5034 738 6336 S Operating Conditions -40 °C to 60 °C 0 0
5043 738 6336 S Operating Conditions -40 °C to 60 °C 0 0
5044 738 6336 S Operating Conditions -40 °C to 60 °C 0 0
5049 738 6336 S Operating Conditions -40 °C to 60 °C 0 0
5050 738 6336 S Operating Conditions -40 °C to 60 °C 0 0
5333 738 7034 S Operating Conditions -40 °C to +60 °C, humidity up to 90% non-condensing 0 0
5363 738 7079 S Operating Conditions −40°C to +60°C, humidity ≤ 90% non-condensing 0 0
5502 738 7307 S Operating Conditions -40 °C to +60 °C; IP67 water & dust protection 0 0
5594 738 7410 S Operating Conditions -30°C to +60°C, Humidity ≤ 95% non-condensing, IP67 rated for dust & water resistance 0 0
6017 738 7733 S Operating Conditions –10 °C to 45 °C, humidity ≤ 95% non-condensing 0 0
6018 738 7743 S Operating Conditions –10°C to 45°C, humidity up to 95% non-condensing 0 0
6185 738 7803 S Operating Conditions -30°C to 60°C, Humidity ≤ 95% (non-condensing) 0 0
6191 738 7856 S Operating Conditions -10 °C to 45 °C, humidity ≤ 95% non-condensing 0 0
5034 645 6426 S Ports 1×RJ-45, 1×DC 0 110
5043 645 6426 S Ports 1×RJ-45, 1×DC 0 110
5044 645 6426 S Ports 1×RJ-45, 1×DC 0 110
5049 645 6426 S Ports 1×RJ-45, 1×DC 0 110
5050 645 6426 S Ports 1×RJ-45, 1×DC 0 110
5333 645 7035 S Ports Video output switchable BNC (TVI/AHD/CVI/CVBS) 0 110
5363 645 7080 S Ports One video output port switchable among TVI / AHD / CVI / CVBS 0 110
5502 645 7301 S Ports 1 x HD analog output 0 110
5594 645 0.00 7412 S Ports Ethernet RJ-45 10/100M, power via PoE or 12 VDC 0 110
6017 645 0.00 7735 S Ports DC input (5 V / 1 A) — no wired network (Ethernet) port 0 110
6018 645 0.00 7745 S Ports USB Type-C port for charging/power input 0 110
6185 645 7805 S Ports 1 × RJ45 10M/100M Ethernet Port 0 110
6191 645 0.00 7858 S Ports DC 5V / 1A power input; no battery; plug-in device 0 110
5034 642 6438 S Resolution 5MP (2880×1620) 0 50
5043 642 6475 S Resolution 5MP (2592×1944) 0 50
5044 642 6475 S Resolution 5MP (2592×1944) 0 50
5049 642 6496 S Resolution 3MP (2048×1536) 0 50
5050 642 6496 S Resolution 3MP (2048×1536) 0 50
5333 642 7017 S Resolution 2 MP (1920 × 1080) Full HD 0 50
5363 642 7017 S Resolution 2 MP (1920 × 1080) Full HD 0 50
5502 642 7300 S Resolution 3K (2960 × 1665) 0 50
5594 642 7411 S Resolution 6 MP (3200 × 1800) Full HD 0 50
6017 642 7734 S Resolution 1080p (1920 × 1080) Full HD 0 50
6018 642 7744 S Resolution Full HD 1080p (1920×1080) at up to ~15 fps, self-adaptive 0 50
6185 642 7017 S Resolution 2 MP (1920 × 1080) Full HD 0 50
6191 642 7857 S Resolution Up to 1920 × 1080 (Full HD) at max ~25 fps with adaptive frame-rate 0 50
5034 646 6439 S Sensor AI detection (person, vehicle, object), alert triggering 0 130
5043 646 6457 S Sensor AI detection (person, vehicle, object) 0 130
5044 646 6457 S Sensor AI detection (person, vehicle, object) 0 130
5049 646 0.00 6457 S Sensor AI detection (person, vehicle, object) 0 130
5050 646 0.00 6457 S Sensor AI detection (person, vehicle, object) 0 130
5333 646 7023 S Sensor 2 MP CMOS 0 130
5363 646 7023 S Sensor 2 MP CMOS 0 130
5502 646 7302 S Sensor 3K CMOS 0 130
5594 646 1.00 7413 S Sensor 1/2.4″ Progressive Scan CMOS 0 130
6017 646 1.00 7736 S Sensor 1/3″ 2-megapixel progressive scan CMOS 0 130
6018 646 1.00 7746 S Sensor 1/2.8″ 2-megapixel progressive scan CMOS 0 130
6185 646 7019 S Sensor 1/2.8" Progressive Scan CMOS 0 130
6191 646 0.00 7859 S Sensor Motion detection; smart alerts; also anti-flicker, watermark, mirror image. 0 130
5034 648 6418 S Storage microSD card slot (up to 256 GB), NAS, cloud 0 170
5043 648 6418 S Storage microSD card slot (up to 256 GB), NAS, cloud 0 170
5044 648 6418 S Storage microSD card slot (up to 256 GB), NAS, cloud 0 170
5049 648 6418 S Storage microSD card slot (up to 256 GB), NAS, cloud 0 170
5050 648 6418 S Storage microSD card slot (up to 256 GB), NAS, cloud 0 170
5333 648 0.00 7036 S Storage Uses external DVRs or recorders compatible with its analog outputs 0 170
5363 648 7036 S Storage Uses external DVRs or recorders compatible with its analog outputs 0 170
5502 648 7036 S Storage Uses external DVRs or recorders compatible with its analog outputs 0 170
5594 648 0.00 7414 S Storage Local storage via microSD up to 512 GB (in “-F” variants); standard models may not include card slot 0 170
6017 648 0.00 7737 S Storage microSD support up to 512 GB + optional EZVIZ CloudPlay subscription 0 170
6018 648 0.00 7747 S Storage Supports microSD cards up to 512 GB + optional EZVIZ CloudPlay storage 0 170
6185 648 7806 S Storage Supports microSD/SDHC/SDXC card, up to 256 GB 0 170
6191 648 0.00 7860 S Storage Supports microSD up to 512 GB; also EZVIZ CloudPlay subscription option 0 170