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 (
    4869, 4872, 4878, 4866, 4877, 4871, 4875, 
    4868, 4860, 4876, 4858, 4859, 4873, 
    4874, 4867, 4865, 4864, 4863
  ) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(166, f.categories_path) 
    OR FIND_IN_SET(170, f.categories_path) 
    OR FIND_IN_SET(530, 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.00419

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "215.20"
    },
    "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": 347,
            "rows_produced_per_join": 112,
            "filtered": "32.52",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (4869,4872,4878,4866,4877,4871,4875,4868,4860,4876,4858,4859,4873,4874,4867,4865,4864,4863)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'en')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "149.38",
              "eval_cost": "11.28",
              "prefix_cost": "160.66",
              "data_read_per_join": "87K"
            },
            "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": "28.21",
              "eval_cost": "1.07",
              "prefix_cost": "200.15",
              "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(170,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(530,`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.69",
              "eval_cost": "1.07",
              "prefix_cost": "203.91",
              "data_read_per_join": "24K"
            },
            "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.69",
              "eval_cost": "1.07",
              "prefix_cost": "207.67",
              "data_read_per_join": "12K"
            },
            "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.69",
              "eval_cost": "1.07",
              "prefix_cost": "211.44",
              "data_read_per_join": "32K"
            },
            "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.69",
              "eval_cost": "1.07",
              "prefix_cost": "215.20",
              "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
4858 641 1647 S Aspect Ratio 16:9 0 30
4859 641 1647 S Aspect Ratio 16:9 0 30
4860 641 1647 S Aspect Ratio 16:9 0 30
4863 641 1649 S Aspect Ratio 21:9 0 30
4864 641 1647 S Aspect Ratio 16:9 0 30
4865 641 1647 S Aspect Ratio 16:9 0 30
4866 641 1647 S Aspect Ratio 16:9 0 30
4867 641 1647 S Aspect Ratio 16:9 0 30
4868 641 1647 S Aspect Ratio 16:9 0 30
4869 641 1647 S Aspect Ratio 16:9 0 30
4871 641 1647 S Aspect Ratio 16:9 0 30
4872 641 1647 S Aspect Ratio 16:9 0 30
4873 641 1647 S Aspect Ratio 16:9 0 30
4874 641 1647 S Aspect Ratio 16:9 0 30
4875 641 1647 S Aspect Ratio 16:9 0 30
4876 641 1647 S Aspect Ratio 16:9 0 30
4877 641 1647 S Aspect Ratio 16:9 0 30
4878 641 1647 S Aspect Ratio 16:9 0 30
4858 657 4960 E Brand HP 0 0
4859 657 4960 E Brand HP 0 0
4860 657 4960 E Brand HP 0 0
4863 657 4960 E Brand HP 0 0
4864 657 4960 E Brand HP 0 0
4865 657 4960 E Brand HP 0 0
4866 657 4960 E Brand HP 0 0
4867 657 4960 E Brand HP 0 0
4868 657 4960 E Brand HP 0 0
4869 657 4960 E Brand HP 0 0
4871 657 4960 E Brand HP 0 0
4872 657 4960 E Brand HP 0 0
4873 657 4960 E Brand HP 0 0
4874 657 4960 E Brand HP 0 0
4875 657 4960 E Brand HP 0 0
4876 657 4960 E Brand HP 0 0
4877 657 4960 E Brand HP 0 0
4878 657 4960 E Brand HP 0 0
4858 656 1560 S Color Black 0 160
4859 656 1560 S Color Black 0 160
4860 656 1559 S Color white 0 160
4863 656 1560 S Color Black 0 160
4864 656 0.00 6128 S Color White/Black 0 160
4865 656 0.00 6130 S Color Black/White 0 160
4866 656 1559 S Color white 0 160
4867 656 1559 S Color white 0 160
4868 656 1560 S Color Black 0 160
4869 656 1560 S Color Black 0 160
4871 656 1559 S Color white 0 160
4872 656 1560 S Color Black 0 160
4873 656 1560 S Color Black 0 160
4874 656 1560 S Color Black 0 160
4875 656 1559 S Color white 0 160
4876 656 1560 S Color Black 0 160
4877 656 6130 S Color Black/White 0 160
4878 656 6130 S Color Black/White 0 160
4858 649 4816 S Display 23.8" 0 20
4859 649 21.45 6125 S Display 21.45" 0 20
4860 649 4819 S Display 31.5" 0 20
4863 649 2878 S Display 34" 0 20
4864 649 4816 S Display 23.8" 0 20
4865 649 4816 S Display 23.8" 0 20
4866 649 4816 S Display 23.8" 0 20
4867 649 1731 S Display 27" 0 20
4868 649 4819 S Display 31.5" 0 20
4869 649 1731 S Display 27" 0 20
4871 649 4816 S Display 23.8" 0 20
4872 649 1731 S Display 27" 0 20
4873 649 1731 S Display 27" 0 20
4874 649 1731 S Display 27" 0 20
4875 649 1731 S Display 27" 0 20
4876 649 1731 S Display 27" 0 20
4877 649 4816 S Display 23.8" 0 20
4878 649 1731 S Display 27" 0 20
4858 645 6124 S Ports 1x HDMI 1.4, 1x VGA, 1x Audio-out (3.5mm headphone jack) 0 110
4859 645 6124 S Ports 1x HDMI 1.4, 1x VGA, 1x Audio-out (3.5mm headphone jack) 0 110
4860 645 6124 S Ports 1x HDMI 1.4, 1x VGA, 1x Audio-out (3.5mm headphone jack) 0 110
4863 645 1.00 6129 S Ports 1 x USB-C, 1 x DisplayPort 1.2, 1 x HDMI 2.0, 4 x USB-A 3.2 Gen 1, 1 x USB-B 0 110
4864 645 6124 S Ports 1x HDMI 1.4, 1x VGA, 1x Audio-out (3.5mm headphone jack) 0 110
4865 645 6124 S Ports 1x HDMI 1.4, 1x VGA, 1x Audio-out (3.5mm headphone jack) 0 110
4866 645 1.00 6131 S Ports 1 x HDMI 1.4, 1 x VGA, 1 x Audio-out (3.5mm headphone jack) 0 110
4867 645 6131 S Ports 1 x HDMI 1.4, 1 x VGA, 1 x Audio-out (3.5mm headphone jack) 0 110
4868 645 1.00 6132 S Ports 1 x HDMI 2.0, 1 x DisplayPort 1.4, 1 x USB-C (65W PD), 1 x USB-C (15W PD), 3 x USB-A, 1 x RJ-45 Ethernet, 1 x Audio-out (3.5mm) 0 110
4869 645 1.00 6133 S Ports 1 x USB-C (65W PD + DP Alt Mode), 1 x HDMI 1.4, 1 x DisplayPort 1.2, 1 x DisplayPort Out, 4x USB-A, 1 x RJ-45 Ethernet, 1 x Audio In/Out (3.5mm) 0 110
4871 645 1.00 6148 S Ports 1 x HDMI 1.4, 1 x VGA 0 110
4872 645 1.00 6149 S Ports 1 x HDMI 1.4, 1 x DisplayPort 1.2, 1 x VGA 0 110
4873 645 6150 S Ports 1 x HDMI 1.4, 1 x DisplayPort™ 1.2, 1 x VGA 0 110
4874 645 1.00 6151 S Ports 1 x DisplayPort 1.2, 1 x HDMI 1.4, 1 x VGA 0 110
4875 645 6152 S Ports 2 x HDMI 1.4, 1 x VGA 0 110
4876 645 1.00 6153 S Ports 1 x DisplayPort 1.4, 2 x HDMI 2.0 0 110
4877 645 6148 S Ports 1 x HDMI 1.4, 1 x VGA 0 110
4878 645 6152 S Ports 2 x HDMI 1.4, 1 x VGA 0 110
4858 650 1729 S Refresh Rate 75Hz 0 40
4859 650 1729 S Refresh Rate 75Hz 0 40
4860 650 1733 S Refresh Rate 100Hz 0 40
4863 650 1539 S Refresh Rate 60Hz 0 40
4864 650 1733 S Refresh Rate 100Hz 0 40
4865 650 1733 S Refresh Rate 100Hz 0 40
4866 650 1733 S Refresh Rate 100Hz 0 40
4867 650 1733 S Refresh Rate 100Hz 0 40
4868 650 1539 S Refresh Rate 60Hz 0 40
4869 650 1729 S Refresh Rate 75Hz 0 40
4871 650 1733 S Refresh Rate 100Hz 0 40
4872 650 1733 S Refresh Rate 100Hz 0 40
4873 650 1729 S Refresh Rate 75Hz 0 40
4874 650 1729 S Refresh Rate 75Hz 0 40
4875 650 1733 S Refresh Rate 100Hz 0 40
4876 650 1542 S Refresh Rate 165Hz 0 40
4877 650 1733 S Refresh Rate 100Hz 0 40
4878 650 1733 S Refresh Rate 100Hz 0 40
4858 642 4211 S Resolution 1920 x 1080 0 50
4859 642 4211 S Resolution 1920 x 1080 0 50
4860 642 4211 S Resolution 1920 x 1080 0 50
4863 642 1944 S Resolution 3440 x 1440 (WQHD) 0 50
4864 642 4211 S Resolution 1920 x 1080 0 50
4865 642 4211 S Resolution 1920 x 1080 0 50
4866 642 4211 S Resolution 1920 x 1080 0 50
4867 642 4211 S Resolution 1920 x 1080 0 50
4868 642 3685 S Resolution 3840 x 2160 (4K) 0 50
4869 642 5628 S Resolution 2560×1440 0 50
4871 642 4211 S Resolution 1920 x 1080 0 50
4872 642 5628 S Resolution 2560×1440 0 50
4873 642 4211 S Resolution 1920 x 1080 0 50
4874 642 4211 S Resolution 1920 x 1080 0 50
4875 642 4211 S Resolution 1920 x 1080 0 50
4876 642 4211 S Resolution 1920 x 1080 0 50
4877 642 4211 S Resolution 1920 x 1080 0 50
4878 642 4211 S Resolution 1920 x 1080 0 50