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 (
    3505, 3322, 3495, 3321, 3332, 3494, 2087, 
    3491, 2012, 1988, 1971, 3486, 3480, 
    3326, 2026, 3496
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(250, f.categories_path) 
    OR FIND_IN_SET(371, f.categories_path) 
    OR FIND_IN_SET(393, 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.00515

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "251.73"
    },
    "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": 408,
            "rows_produced_per_join": 132,
            "filtered": "32.51",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (3505,3322,3495,3321,3332,3494,2087,3491,2012,1988,1971,3486,3480,3326,2026,3496)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'ar')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "174.34",
              "eval_cost": "13.27",
              "prefix_cost": "187.61",
              "data_read_per_join": "102K"
            },
            "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": 12,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "33.17",
              "eval_cost": "1.26",
              "prefix_cost": "234.04",
              "data_read_per_join": "5K"
            },
            "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(250,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(371,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(393,`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": 12,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.16",
              "eval_cost": "1.26",
              "prefix_cost": "238.46",
              "data_read_per_join": "28K"
            },
            "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": 12,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.16",
              "eval_cost": "1.26",
              "prefix_cost": "242.89",
              "data_read_per_join": "14K"
            },
            "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": 12,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.16",
              "eval_cost": "1.26",
              "prefix_cost": "247.31",
              "data_read_per_join": "38K"
            },
            "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": 12,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.16",
              "eval_cost": "1.26",
              "prefix_cost": "251.74",
              "data_read_per_join": "5K"
            },
            "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
1971 659 2154 S Connectivity USB 2.0, Wi-Fi, Wi-Fi Direct 0 152
1988 659 2154 S Connectivity USB 2.0, Wi-Fi, Wi-Fi Direct 0 152
2012 659 2127 S Connectivity USB 2.0, Ethernet, Wi-Fi (2.4GHz & 5GHz), Wi-Fi Direct 0 152
2026 659 2127 S Connectivity USB 2.0, Ethernet, Wi-Fi (2.4GHz & 5GHz), Wi-Fi Direct 0 152
2087 659 0.00 2195 S Connectivity USB 2.0, Ethernet, Wi-Fi, Wi-Fi Direct 0 152
3321 659 3747 S Connectivity USB 2.0, Wi-Fi, Canon PRINT app, PIXMA Cloud Link, Mopria, Google Cloud Print 0 152
3322 659 3749 S Connectivity USB2.0, Wi-Fi, Cloud Link, Mopria, Canon PRINT app 0 152
3326 659 3755 S Connectivity USB 2.0, Wi-Fi, Canon PRINT App, Cloud Link, Airprint, Mopria 0 152
3332 659 3772 S Connectivity USB 2.0, Wi-Fi, Canon PRINT app, Mopria, Cloud 0 152
3480 659 0.00 4406 S Connectivity USB 2.0, Ethernet, Wi-Fi, Wi-Fi Direct, Bluetooth, Epson iPrint, Epson Connect, Apple AirPrint, Google Cloud Print 0 152
3486 659 4094 S Connectivity USB 2.0, Wi‑Fi, Wi‑Fi Direct, Epson mobile/cloud apps 0 152
3491 659 2199 S Connectivity USB 2.0 0 152
3494 659 4122 S Connectivity Connectivity: USB 2.0, Wi‑Fi (802.11b/g/n), Wi‑Fi Direct; Epson Smart Panel, AirPrint, Mopria, Epson Connect suite 0 152
3495 659 4127 S Connectivity USB 2.0, Wi-Fi, Wi-Fi Direct, Ethernet 0 152
3496 659 4129 S Connectivity USB 2.0, Ethernet, Wi‑Fi (802.11 b/g/n), Wi‑Fi Direct; Epson Smart Panel, iPrint, Email Print, Remote Print Driver, AirPrint, Mopria 0 152
3505 659 0.00 4156 S Connectivity USB 2.0, Ethernet, Wi‑Fi (a/b/g/n/ac), Wi‑Fi Direct; mobile/cloud apps: Epson Smart Panel, iPrint, Email Print, Remote Print Driver, Scan-to-Cloud; AirPrint, Mopria 0 152
1971 675 2123 S Duplex Printing Yes (Automatic) 0 0
1988 675 2123 S Duplex Printing Yes (Automatic) 0 0
2012 675 2123 S Duplex Printing Yes (Automatic) 0 0
2026 675 2123 S Duplex Printing Yes (Automatic) 0 0
2087 675 2123 S Duplex Printing Yes (Automatic) 0 0
3321 675 3706 S Duplex Printing Manual (no auto duplex) 0 0
3322 675 3710 S Duplex Printing Manual 0 0
3326 675 3706 S Duplex Printing Manual (no auto duplex) 0 0
3332 675 3706 S Duplex Printing Manual (no auto duplex) 0 0
3480 675 4017 S Duplex Printing Automatic 0 0
3486 675 3710 S Duplex Printing Manual 0 0
3491 675 3710 S Duplex Printing Manual 0 0
3494 675 3710 S Duplex Printing Manual 0 0
3495 675 4017 S Duplex Printing Automatic 0 0
3496 675 3710 S Duplex Printing Manual 0 0
3505 675 4017 S Duplex Printing Automatic 0 0
1971 672 2119 S Function Print, Scan, Copy 0 0
1988 672 2119 S Function Print, Scan, Copy 0 0
2012 672 2119 S Function Print, Scan, Copy 0 0
2026 672 0.00 2187 S Function Print, Scan, Copy, Fax 0 0
2087 672 2187 S Function Print, Scan, Copy, Fax 0 0
3321 672 2119 S Function Print, Scan, Copy 0 0
3322 672 2119 S Function Print, Scan, Copy 0 0
3326 672 2119 S Function Print, Scan, Copy 0 0
3332 672 2119 S Function Print, Scan, Copy 0 0
3480 672 2187 S Function Print, Scan, Copy, Fax 0 0
3486 672 2119 S Function Print, Scan, Copy 0 0
3491 672 2133 S Function Print 0 0
3494 672 2119 S Function Print, Scan, Copy 0 0
3495 672 2187 S Function Print, Scan, Copy, Fax 0 0
3496 672 2187 S Function Print, Scan, Copy, Fax 0 0
3505 672 2187 S Function Print, Scan, Copy, Fax 0 0
1971 673 2155 S Print Speed Up to 16 ipm (Mono), Up to 9 ipm (Colour) 0 0
1988 673 0.00 2170 S Print Speed Up to 16 ipm (Mono), Up to 15.5 ipm (Color) 0 0
2012 673 0.00 2171 S Print Speed Up to 17 ipm (Mono), Up to 16.5 ipm (Color) 0 0
2026 673 0.00 2188 S Print Speed Up to 17 ipm (Mono), Up to 16.5 ipm (Colou 0 0
2087 673 0.00 2192 S Print Speed Up to 22 ipm (Mono), Up to 20 ipm (Colour) 0 0
3321 673 3746 S Print Speed Up to 8.8 ipm (Mono), Up to 5 ipm (Colour) 0 0
3322 673 3746 S Print Speed Up to 8.8 ipm (Mono), Up to 5 ipm (Colour) 0 0
3326 673 3753 S Print Speed Up to 11 ipm (Mono), Up to 6 ipm (Colour) 0 0
3332 673 3753 S Print Speed Up to 11 ipm (Mono), Up to 6 ipm (Colour) 0 0
3480 673 4085 S Print Speed Up to 24 ppm 0 0
3486 673 4095 S Print Speed 10 ipm (black) / 5 ipm (color) ,up to 33 ppm (black) / 15 ppm (color) 0 0
3491 673 4115 S Print Speed Up to 15 ppm (black), 5.5 ppm (color) 0 0
3494 673 4120 S Print Speed Up to 15 ipm (black mono ISO) / 8 ipm (color ISO); Draft up to 33 ppm (mono) / 20 ppm (color) 0 0
3495 673 4124 S Print Speed Up to 25 ppm (mono & color), Duplex: ~21 ipm 0 0
3496 673 4128 S Print Speed Up to 15 ipm (mono) / 8 ipm (color); draft: up to 33 ppm / 20 ppm 0 0
3505 673 4154 S Print Speed (A4 ISO): 25 ipm (black), 12 ipm (color); Draft mode up to 32 ppm/22 ppm 0 0
1971 642 2156 S Resolution Up to 1200 × 6000 dpi 0 50
1988 642 2156 S Resolution Up to 1200 × 6000 dpi 0 50
2012 642 2156 S Resolution Up to 1200 × 6000 dpi 0 50
2026 642 2156 S Resolution Up to 1200 × 6000 dpi 0 50
2087 642 0.00 2194 S Resolution Up to 1200 × 4800 dpi 0 50
3321 642 3723 S Resolution Up to 4800 x 1200 dpi 0 50
3322 642 3723 S Resolution Up to 4800 x 1200 dpi 0 50
3326 642 3723 S Resolution Up to 4800 x 1200 dpi 0 50
3332 642 3723 S Resolution Up to 4800 x 1200 dpi 0 50
3480 642 4075 S Resolution 4800 x 1200 0 50
3486 642 3713 S Resolution 5760 x 1440 0 50
3491 642 3713 S Resolution 5760 x 1440 0 50
3494 642 3713 S Resolution 5760 x 1440 0 50
3495 642 4126 S Resolution 4800 x 2400 0 50
3496 642 4075 S Resolution 4800 x 1200 0 50
3505 642 4126 S Resolution 4800 x 2400 0 50
2026 674 0.00 2189 S Scan Speed Flatbed: 3.35 sec (Mono), 4.38 sec (Colour) @100 dpi 0 0
2087 674 0.00 2193 S Scan Speed Up to 18 ipm (A4 Portrait, Mono/Colour), Up to 11 ipm (A4 Landscape, Mono/Colour), Up to 8 ipm (A3, Mono/Colour) 0 0
3326 674 3754 S Scan Speed 600 × 1200 dpi; line speed, 3.5 ms/line color, 1.5 ms/line grayscale 0 0
3332 674 3771 S Scan Speed Approx. 19 sec (A4) 0 0
3494 674 4121 S Scan Speed 11 sec (A4 black, 200 dpi), ~28 sec (A4 color, 200 dpi) 0 0
3495 674 4125 S Scan Speed 26 ipm (simplex), 11.5 ipm (duplex), Color: 9 ipm (simplex), 6 ipm (duplex) 0 0
3496 674 4130 S Scan Speed Black: 12 s (≈ 4.5 ipm); Color: 29 s (≈ 4.5 ipm) 0 0
3505 674 4155 S Scan Speed Black: 26 ipm (simplex) / 11.5 ipm (duplex); Color: 9 ipm / 6 ipm 0 0
1971 648 2145 S التخزين 128 MB 0 170
1988 648 2145 S التخزين 128 MB 0 170
2012 648 2145 S التخزين 128 MB 0 170
2026 648 2145 S التخزين 128 MB 0 170
2087 648 2145 S التخزين 128 MB 0 170
3321 648 3748 S التخزين None (Host controlled) 0 170
3322 648 3748 S التخزين None (Host controlled) 0 170
3326 648 3748 S التخزين None (Host controlled) 0 170
3332 648 3773 S التخزين None (Device controlled) 0 170
3480 648 4016 S التخزين None 0 170
3486 648 4016 S التخزين None 0 170
3491 648 4016 S التخزين None 0 170
3494 648 4016 S التخزين None 0 170
3495 648 4016 S التخزين None 0 170
3496 648 4016 S التخزين None 0 170
3505 648 4016 S التخزين None 0 170
1971 656 1560 S لون Black 0 160
1988 656 1560 S لون Black 0 160
2012 656 1560 S لون Black 0 160
2026 656 1560 S لون Black 0 160
2087 656 1560 S لون Black 0 160
3321 656 1560 S لون Black 0 160
3322 656 1560 S لون Black 0 160
3332 656 1560 S لون Black 0 160
3480 656 1559 S لون White 0 160
3486 656 1559 S لون White 0 160
3491 656 1560 S لون Black 0 160
3494 656 1560 S لون Black 0 160
3495 656 1559 S لون White 0 160
3496 656 1560 S لون Black 0 160
3505 656 1560 S لون Black 0 160
3326 656 1558 S لون Pink 0 160
1971 657 2118 E ماركة Brother 0 0
1988 657 2118 E ماركة Brother 0 0
2012 657 2118 E ماركة Brother 0 0
2026 657 2118 E ماركة Brother 0 0
2087 657 2118 E ماركة Brother 0 0
3321 657 3745 E ماركة Canon 0 0
3322 657 3745 E ماركة Canon 0 0
3326 657 3745 E ماركة Canon 0 0
3332 657 3745 E ماركة Canon 0 0
3480 657 3705 E ماركة Epson 0 0
3486 657 3705 E ماركة Epson 0 0
3491 657 3705 E ماركة Epson 0 0
3494 657 3705 E ماركة Epson 0 0
3495 657 3705 E ماركة Epson 0 0
3496 657 3705 E ماركة Epson 0 0
3505 657 3705 E ماركة Epson 0 0