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 = 'ar' 
  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 = 'ar' 
  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 (
    5384, 5385, 6371, 6356, 6332, 6362, 6354, 
    6331, 6337, 6364, 6359, 6330, 6355
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(521, f.categories_path) 
    OR FIND_IN_SET(538, f.categories_path) 
    OR FIND_IN_SET(539, 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 = 'ar' 
ORDER BY 
  fd.description, 
  fv.position

Query time 0.00420

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "167.19"
    },
    "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": 270,
            "rows_produced_per_join": 87,
            "filtered": "32.51",
            "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (5384,5385,6371,6356,6332,6362,6354,6331,6337,6364,6359,6330,6355))",
            "cost_info": {
              "read_cost": "115.98",
              "eval_cost": "8.78",
              "prefix_cost": "124.76",
              "data_read_per_join": "67K"
            },
            "used_columns": [
              "feature_id",
              "product_id",
              "variant_id",
              "value",
              "value_int",
              "lang_code"
            ],
            "attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar') 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": 8,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "21.95",
              "eval_cost": "0.84",
              "prefix_cost": "155.49",
              "data_read_per_join": "3K"
            },
            "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(538,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(539,`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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.09",
              "eval_cost": "0.84",
              "prefix_cost": "158.41",
              "data_read_per_join": "19K"
            },
            "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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.09",
              "eval_cost": "0.84",
              "prefix_cost": "161.34",
              "data_read_per_join": "9K"
            },
            "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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.09",
              "eval_cost": "0.84",
              "prefix_cost": "164.27",
              "data_read_per_join": "25K"
            },
            "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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.09",
              "eval_cost": "0.84",
              "prefix_cost": "167.20",
              "data_read_per_join": "3K"
            },
            "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
6362 659 8152 S Connectivity Remote monitoring via app or browser 0 152
6354 659 0.00 8144 S Connectivity Remote access via app or browser 0 152
6330 659 0.00 8123 S Connectivity Remote access via app and browser 0 152
6364 659 8152 S Connectivity Remote monitoring via app or browser 0 152
6359 659 8144 S Connectivity Remote access via app or browser 0 152
5385 659 6417 S Connectivity Wired (Ethernet) 0 152
6337 659 8132 S Connectivity Network access with remote monitoring capability 0 152
6331 659 0.00 8128 S Connectivity Remote access via app, web, and network integration 0 152
6355 659 8144 S Connectivity Remote access via app or browser 0 152
6356 659 0.00 8147 S Connectivity Remote access via app or web browser 0 152
5384 659 7156 S Connectivity Wired (Ethernet, PoE) 0 152
6371 659 8152 S Connectivity Remote monitoring via app or browser 0 152
6332 659 0.00 8132 S Connectivity Network access with remote monitoring capability 0 152
6332 761 8130 S Data Security Encrypted data protection and secure user access 0 0
6359 761 8151 S Data Security Encrypted data and secure access 0 0
6337 761 8120 S Data Security Encryption and secure access control 0 0
6362 761 8151 S Data Security Encrypted data and secure access 0 0
6364 761 8151 S Data Security Encrypted data and secure access 0 0
6331 761 8125 S Data Security Encrypted data and secure access management 0 0
6330 761 8120 S Data Security Encryption and secure access control 0 0
5385 761 7153 S Data Security Multi-level User Authentication, Data Encryption 0 0
6354 761 8142 S Data Security Encryption and secure access management 0 0
6371 761 8169 S Data Security Encrypted data and secure user access 0 0
6355 761 8145 S Data Security Encryption and secure user access 0 0
5384 761 7153 S Data Security Multi-level User Authentication, Data Encryption 0 0
6356 761 8130 S Data Security Encrypted data protection and secure user access 0 0
6354 645 8122 S Ports 16 PoE, HDMI, VGA, USB, LAN 0 110
6359 645 8146 S Ports 8 PoE, HDMI, VGA, USB, LAN 0 110
5384 645 4.00 7164 S Ports 4 × PoE, HDMI, VGA, USB, LAN 0 110
6337 645 0.00 8134 S Ports HDMI, VGA, USB, LAN, audio interfaces 0 110
6355 645 8.00 8146 S Ports 8 PoE, HDMI, VGA, USB, LAN 0 110
6356 645 7161 S Ports HDMI, VGA, USB, LAN 0 110
6371 645 7161 S Ports HDMI, VGA, USB, LAN 0 110
6362 645 8122 S Ports 16 PoE, HDMI, VGA, USB, LAN 0 110
5385 645 7161 S Ports HDMI, VGA, USB, LAN 0 110
6331 645 0.00 8127 S Ports HDMI, VGA, USB, LAN, and audio interfaces 0 110
6364 645 8146 S Ports 8 PoE, HDMI, VGA, USB, LAN 0 110
6330 645 16.00 8122 S Ports 16 PoE, HDMI, VGA, USB, LAN 0 110
6332 645 8127 S Ports HDMI, VGA, USB, LAN, and audio interfaces 0 110
6359 642 8153 S Resolution 8K UHD 0 50
6356 642 8143 S Resolution 4K UHD 0 50
5384 642 7154 S Resolution Up to 8MP Input / 4K Output 0 50
5385 642 7154 S Resolution Up to 8MP Input / 4K Output 0 50
6355 642 8143 S Resolution 4K UHD 0 50
6371 642 8143 S Resolution 4K UHD 0 50
6354 642 8143 S Resolution 4K UHD 0 50
6330 642 8121 S Resolution 4K UHD recording 0 50
6364 642 8143 S Resolution 4K UHD 0 50
6331 642 8126 S Resolution 4K UHD video recording and playback 0 50
6337 642 8126 S Resolution 4K UHD video recording and playback 0 50
6332 642 8131 S Resolution 8K UHD video recording and playback 0 50
6362 642 8143 S Resolution 4K UHD 0 50
6364 648 8148 S التخزين Multi-HDD support for long recordings 0 170
6356 648 0.00 8148 S التخزين Multi-HDD support for long recordings 0 170
6362 648 8148 S التخزين Multi-HDD support for long recordings 0 170
6359 648 8148 S التخزين Multi-HDD support for long recordings 0 170
6371 648 8148 S التخزين Multi-HDD support for long recordings 0 170
6331 648 0.00 8129 S التخزين Multiple HDD bays for extended video storage 0 170
5384 648 7160 S التخزين 1 × SATA (Up to 10TB) 0 170
5385 648 7160 S التخزين 1 × SATA (Up to 10TB) 0 170
6330 648 0.00 8124 S التخزين Multi-HDD support for long recording 0 170
6332 648 0.00 8133 S التخزين Multi-HDD support for extended recording time 0 170
6355 648 8124 S التخزين Multi-HDD support for long recording 0 170
6354 648 8124 S التخزين Multi-HDD support for long recording 0 170
6330 656 1560 S لون Black 0 160
6364 656 1560 S لون Black 0 160
6356 656 1560 S لون Black 0 160
6331 656 1560 S لون Black 0 160
6362 656 1560 S لون Black 0 160
5385 656 1560 S لون Black 0 160
6332 656 1560 S لون Black 0 160
6355 656 1560 S لون Black 0 160
5384 656 1560 S لون Black 0 160
6359 656 1560 S لون Black 0 160
6337 656 1560 S لون Black 0 160
6354 656 1560 S لون Black 0 160
6371 656 1560 S لون Black 0 160
6371 657 6403 E ماركة Hikvision 0 0
5384 657 6404 E ماركة Holowits 0 0
5385 657 6404 E ماركة Holowits 0 0
6331 657 6403 E ماركة Hikvision 0 0
6330 657 6403 E ماركة Hikvision 0 0
6364 657 6403 E ماركة Hikvision 0 0
6356 657 6403 E ماركة Hikvision 0 0
6332 657 6403 E ماركة Hikvision 0 0
6362 657 6403 E ماركة Hikvision 0 0
6355 657 6403 E ماركة Hikvision 0 0
6337 657 6403 E ماركة Hikvision 0 0
6354 657 6403 E ماركة Hikvision 0 0
6359 657 6403 E ماركة Hikvision 0 0