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 (
    4115, 4297, 4269, 4185, 4587, 4212, 4280, 
    4602, 4347, 4454, 4207, 4130, 4312, 
    4254, 4346, 4500, 4290
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(166, f.categories_path) 
    OR FIND_IN_SET(513, f.categories_path) 
    OR FIND_IN_SET(514, 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.00392

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "201.59"
    },
    "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": 325,
            "rows_produced_per_join": 105,
            "filtered": "32.51",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (4115,4297,4269,4185,4587,4212,4280,4602,4347,4454,4207,4130,4312,4254,4346,4500,4290)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "139.94",
              "eval_cost": "10.57",
              "prefix_cost": "150.51",
              "data_read_per_join": "81K"
            },
            "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": "26.42",
              "eval_cost": "1.01",
              "prefix_cost": "187.50",
              "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(513,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(514,`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.52",
              "eval_cost": "1.01",
              "prefix_cost": "191.02",
              "data_read_per_join": "22K"
            },
            "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.52",
              "eval_cost": "1.01",
              "prefix_cost": "194.54",
              "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.52",
              "eval_cost": "1.01",
              "prefix_cost": "198.07",
              "data_read_per_join": "30K"
            },
            "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.52",
              "eval_cost": "1.01",
              "prefix_cost": "201.59",
              "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
4115 727 5183 S Data Security AES 256-bit encryption support 0 0
4130 727 5195 S Data Security Supports HDD password protection via compatible software to prevent unauthorized access. 0 0
4185 727 5286 S Data Security Water-resistant casing for added protection 0 0
4207 727 5330 S Data Security Enclosure with water, dust, and shock resistance 0 0
4212 727 5341 S Data Security Durable enclosure for safe storage 0 0
4254 727 5275 S Data Security Water-resistant casing for added data protection 0 0
4269 727 5414 S Data Security Protects data with shock- and water-resistant design 0 0
4280 727 5429 S Data Security Reliable storage for backups, media, and important files 0 0
4290 727 5429 S Data Security Reliable storage for backups, media, and important files 0 0
4297 727 5466 S Data Security AES 256-bit encryption with HDDtoGO software suppor 0 0
4312 727 5479 S Data Security N/A 0 0
4346 727 5479 S Data Security N/A 0 0
4347 727 5496 S Data Security Password protection supported via ADATA software 0 0
4454 727 5530 S Data Security Supports AES 256-bit encryption via ADATA software 0 0
4500 727 5567 S Data Security Supports OS based password protection and encryption if configured 0 0
4587 727 5726 S Data Security standard data protection 0 0
4602 727 5748 S Data Security Standard HDD 0 0
4115 645 5185 S Ports USB 3.2 Type-A (backward compatible with USB 2.0) 0 110
4130 645 5197 S Ports USB 3.2 Gen 1 (backward compatible with USB 2.0) interface. 0 110
4185 645 5277 S Ports USB 3.2 (backward-compatible with USB 2.0) 0 110
4207 645 5332 S Ports USB 3.2 (backward compatible with USB 2.0) 0 110
4212 645 5332 S Ports USB 3.2 (backward compatible with USB 2.0) 0 110
4254 645 5277 S Ports USB 3.2 (backward-compatible with USB 2.0) 0 110
4269 645 5332 S Ports USB 3.2 (backward compatible with USB 2.0) 0 110
4280 645 5332 S Ports USB 3.2 (backward compatible with USB 2.0) 0 110
4290 645 5452 S Ports USB 3.2 Gen1 (backward compatible with USB 2.0) 0 110
4297 645 5452 S Ports USB 3.2 Gen1 (backward compatible with USB 2.0) 0 110
4312 645 5277 S Ports USB 3.2 (backward-compatible with USB 2.0) 0 110
4346 645 5495 S Ports USB 3.2 Gen 1 (backward-compatible with USB 2.0) 0 110
4347 645 5495 S Ports USB 3.2 Gen 1 (backward-compatible with USB 2.0) 0 110
4454 645 5532 S Ports USB 3.2 Gen1 0 110
4500 645 5452 S Ports USB 3.2 Gen1 (backward compatible with USB 2.0) 0 110
4587 645 5452 S Ports USB 3.2 Gen1 (backward compatible with USB 2.0) 0 110
4602 645 5532 S Ports USB 3.2 Gen1 0 110
4115 726 5184 S Shok Sensor Protection Shock-resistant silicone casing with built-in shock sensors 0 0
4130 726 5196 S Shok Sensor Protection Equipped with a shock sensor that automatically stops the drive when impact is detected to protect data integrity 0 0
4185 726 5276 S Shok Sensor Protection Rugged, shock-resistant design 0 0
4207 726 5331 S Shok Sensor Protection Military-grade, triple-layer protection 0 0
4212 726 5342 S Shok Sensor Protection Resistant to drops and impacts 0 0
4254 726 5276 S Shok Sensor Protection Rugged, shock-resistant design 0 0
4269 726 5415 S Shok Sensor Protection Shock- and vibration-resistant construction 0 0
4280 726 5430 S Shok Sensor Protection Shock-resistant design protects against accidental drops 0 0
4290 726 5451 S Shok Sensor Protection Shock-resistant design protects against drops and impacts 0 0
4297 726 5467 S Shok Sensor Protection Built-in shock sensors pause drive activity during impacts to protect data 0 0
4312 726 5481 S Shok Sensor Protection Anti-shock design for protection against drops and impacts 0 0
4346 726 5494 S Shok Sensor Protection Shock-resistant design 0 0
4347 726 5494 S Shok Sensor Protection Shock-resistant design 0 0
4454 726 5537 S Shok Sensor Protection rugged design with shock resistance 0 0
4500 726 5589 S Shok Sensor Protection Triple layer anti shock design makes it resistant to vibration and minor physical shocks 0 0
4587 726 5727 S Shok Sensor Protection Shock-resistant, rugged design 0 0
4602 726 5749 S Shok Sensor Protection Limited protection; standard external hard drive design 0 0
4115 728 5522 S Storage type External 0 0
4130 728 5522 S Storage type External 0 0
4185 728 5522 S Storage type External 0 0
4207 728 5522 S Storage type External 0 0
4212 728 5522 S Storage type External 0 0
4254 728 5522 S Storage type External 0 0
4269 728 5522 S Storage type External 0 0
4280 728 5522 S Storage type External 0 0
4290 728 5522 S Storage type External 0 0
4297 728 5522 S Storage type External 0 0
4312 728 5522 S Storage type External 0 0
4346 728 5522 S Storage type External 0 0
4347 728 5522 S Storage type External 0 0
4454 728 5522 S Storage type External 0 0
4500 728 5588 S Storage type External HDD 0 0
4587 728 5522 S Storage type External 0 0
4602 728 5588 S Storage type External HDD 0 0
4212 648 1564 S التخزين 1TB 0 170
4254 648 1564 S التخزين 1TB 0 170
4269 648 1564 S التخزين 1TB 0 170
4290 648 1564 S التخزين 1TB 0 170
4312 648 1564 S التخزين 1TB 0 170
4454 648 1564 S التخزين 1TB 0 170
4587 648 1564 S التخزين 1TB 0 170
4130 648 1565 S التخزين 2TB 0 170
4185 648 1565 S التخزين 2TB 0 170
4207 648 1565 S التخزين 2TB 0 170
4297 648 1565 S التخزين 2TB 0 170
4347 648 1565 S التخزين 2TB 0 170
4115 648 5186 S التخزين 4TB 0 170
4346 648 5186 S التخزين 4TB 0 170
4500 648 5186 S التخزين 4TB 0 170
4280 648 5431 S التخزين 5TB 0 170
4602 648 8.00 5750 S التخزين 8TB 0 170
4115 656 1560 S لون Black 0 160
4130 656 2315 S لون Red 0 160
4185 656 1560 S لون Black 0 160
4207 656 1560 S لون Black 0 160
4212 656 1560 S لون Black 0 160
4254 656 2315 S لون Red 0 160
4269 656 1560 S لون Black 0 160
4280 656 1560 S لون Black 0 160
4290 656 5453 S لون Camouflage 0 160
4297 656 1560 S لون Black 0 160
4312 656 1560 S لون Black 0 160
4346 656 1560 S لون Black 0 160
4347 656 1560 S لون Black 0 160
4454 656 1560 S لون Black 0 160
4500 656 3814 S لون Black/Grey 0 160
4587 656 1560 S لون Black 0 160
4602 656 1560 S لون Black 0 160
4115 657 5176 E ماركة ADATA 0 0
4130 657 5176 E ماركة ADATA 0 0
4185 657 5176 E ماركة ADATA 0 0
4207 657 5176 E ماركة ADATA 0 0
4212 657 5176 E ماركة ADATA 0 0
4254 657 5176 E ماركة ADATA 0 0
4269 657 5176 E ماركة ADATA 0 0
4280 657 5176 E ماركة ADATA 0 0
4290 657 5176 E ماركة ADATA 0 0
4297 657 5176 E ماركة ADATA 0 0
4312 657 5176 E ماركة ADATA 0 0
4346 657 5176 E ماركة ADATA 0 0
4347 657 5176 E ماركة ADATA 0 0
4454 657 5176 E ماركة ADATA 0 0
4500 657 5176 E ماركة ADATA 0 0
4587 657 5176 E ماركة ADATA 0 0
4602 657 5176 E ماركة ADATA 0 0