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 (3033, 3039, 3037, 3031) 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(166, f.categories_path) 
    OR FIND_IN_SET(320, f.categories_path) 
    OR FIND_IN_SET(469, 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.00826

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "108.48"
    },
    "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": 177,
            "rows_produced_per_join": 57,
            "filtered": "32.52",
            "index_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`v`.`product_id` in (3033,3039,3037,3031)) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`lang_code` = 'en')) and (`softwarepirmam_hewadelivard_cscart_4`.`v`.`feature_id` is not null))",
            "cost_info": {
              "read_cost": "74.90",
              "eval_cost": "5.76",
              "prefix_cost": "80.66",
              "data_read_per_join": "44K"
            },
            "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": 5,
            "filtered": "9.53",
            "cost_info": {
              "read_cost": "14.39",
              "eval_cost": "0.55",
              "prefix_cost": "100.80",
              "data_read_per_join": "2K"
            },
            "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(320,`softwarepirmam_hewadelivard_cscart_4`.`f`.`categories_path`)) or (0 <> find_in_set(469,`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": 5,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.37",
              "eval_cost": "0.55",
              "prefix_cost": "102.72",
              "data_read_per_join": "12K"
            },
            "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": 5,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.37",
              "eval_cost": "0.55",
              "prefix_cost": "104.64",
              "data_read_per_join": "6K"
            },
            "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": 5,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.37",
              "eval_cost": "0.55",
              "prefix_cost": "106.56",
              "data_read_per_join": "16K"
            },
            "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": 5,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.37",
              "eval_cost": "0.55",
              "prefix_cost": "108.48",
              "data_read_per_join": "2K"
            },
            "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
3031 641 1655 S Aspect Ratio 3:2 0 30
3039 641 2070 S Aspect Ratio 16:10 0 30
3037 641 1655 S Aspect Ratio 3:2 0 30
3033 641 1655 S Aspect Ratio 3:2 0 30
3039 653 3450 S Battery 7,700mAh 0 100
3037 653 3436 S Battery 10,100mAh 0 100
3033 653 3441 S Battery 8,800mAh 0 100
3031 653 3436 S Battery 10,100mAh 0 100
3039 657 1945 E Brand Huawei 0 0
3037 657 1945 E Brand Huawei 0 0
3033 657 1945 E Brand Huawei 0 0
3031 657 1945 E Brand Huawei 0 0
3031 654 1771 S Charging Type USB-C 0 120
3037 654 1771 S Charging Type USB-C 0 120
3033 654 1771 S Charging Type USB-C 0 120
3039 654 1771 S Charging Type USB-C 0 120
3037 656 1560 S Color Black 0 160
3033 656 3442 S Color Violet 0 160
3039 656 2077 S Color Grey 0 160
3031 656 2077 S Color Grey 0 160
3033 649 3432 S Display 11.5" 0 20
3037 649 3443 S Display 12.2" 0 20
3031 649 3432 S Display 11.5" 0 20
3039 649 1571 S Display 11" 0 20
3033 647 1799 S Front Camera 8MP 0 150
3031 647 1799 S Front Camera 8MP 0 150
3037 647 1799 S Front Camera 8MP 0 150
3039 647 1854 S Front Camera 5MP 0 150
3037 652 3445 S GPU Mali‑G710 MP4 0 80
3033 652 3440 S GPU Integrated (Mali-based within Kirin) 0 80
3039 652 3449 S GPU Adreno 610 0 80
3031 652 3435 S GPU Adreno 662 0 80
3031 640 3431 S Operating System HarmonyOS 4.3 0 10
3039 640 3447 S Operating System HarmonyOS 2.0 0 10
3037 640 3437 S Operating System HarmonyOS 4.2 0 10
3033 640 3437 S Operating System HarmonyOS 4.2 0 10
3039 651 3448 S Processor Qualcomm Snapdragon 685 0 60
3033 651 3439 S Processor Kirin 9000WL 0 60
3037 651 3444 S Processor Kirin 9000S 0 60
3031 651 3434 S Processor Qualcomm Snapdragon 7 Gen 1 0 60
3039 643 1591 S Ram 6GB 0 70
3031 643 1526 S Ram 8GB 0 70
3033 643 1526 S Ram 8GB 0 70
3037 643 1587 S Ram 12GB 0 70
3039 655 1853 S Rear Camera 8MP 0 140
3031 655 1859 S Rear Camera 13MP 0 140
3037 655 1859 S Rear Camera 13MP 0 140
3033 655 1859 S Rear Camera 13MP 0 140
3037 650 1541 S Refresh Rate 144Hz 0 40
3033 650 1541 S Refresh Rate 144Hz 0 40
3031 650 1540 S Refresh Rate 120Hz 0 40
3039 650 1539 S Refresh Rate 60Hz 0 40
3033 642 3438 S Resolution 2800 x 1840 0 50
3039 642 2275 S Resolution 1920 x 1200 0 50
3037 642 3438 S Resolution 2800 x 1840 0 50
3031 642 3433 S Resolution 2200 x 1440 0 50
3031 644 3035 S SIM Wi-Fi only 0 90
3033 644 3035 S SIM Wi-Fi only 0 90
3039 644 3035 S SIM Wi-Fi only 0 90
3037 644 3446 S SIM Wi‑Fi only or optional LTE 0 90
3031 648 1561 S Storage 128GB 0 170
3039 648 1561 S Storage 128GB 0 170
3033 648 1562 S Storage 256GB 0 170
3037 648 1563 S Storage 512GB 0 170