SELECT 
  pfv.feature_id, 
  pfv.product_id, 
  pfv.variant_id, 
  fv.position, 
  fvd.variant 
FROM 
  cscart_product_features_values AS pfv 
  INNER JOIN cscart_product_feature_variants AS fv ON pfv.feature_id = fv.feature_id 
  AND pfv.variant_id = fv.variant_id 
  INNER JOIN cscart_product_feature_variant_descriptions AS fvd ON pfv.variant_id = fvd.variant_id 
  AND fvd.lang_code = 'vi' 
WHERE 
  pfv.feature_id IN (
    21387, 24997, 24996, 25008, 24830, 23686, 
    24836, 23432, 20077, 24746, 24745
  ) 
  AND pfv.product_id IN (
    1893, 49169, 49164, 49230, 47631, 42255, 
    40350, 47655, 33312, 5300, 47024, 47020, 
    47023, 47022
  ) 
  AND pfv.lang_code = 'vi'

Query time 0.01669

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "pfv",
          "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",
          "key_length": "12",
          "used_key_parts": ["product_id", "feature_id", "lang_code"],
          "rows": 163,
          "filtered": 95.70552063,
          "attached_condition": "pfv.feature_id in (21387,24997,24996,25008,24830,23686,24836,23432,20077,24746,24745) and pfv.product_id in (1893,49169,49164,49230,47631,42255,40350,47655,33312,5300,47024,47020,47023,47022) and pfv.lang_code = 'vi'",
          "using_index": true
        }
      },
      {
        "table": {
          "table_name": "fv",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY", "feature_id"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["variant_id"],
          "ref": ["dev_db.pfv.variant_id"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "fv.feature_id = pfv.feature_id"
        }
      },
      {
        "table": {
          "table_name": "fvd",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "9",
          "used_key_parts": ["variant_id", "lang_code"],
          "ref": ["dev_db.pfv.variant_id", "const"],
          "rows": 1,
          "filtered": 100,
          "index_condition": "fvd.lang_code = 'vi'"
        }
      }
    ]
  }
}

Result

feature_id product_id variant_id position variant
21387 1893 74806 0 Gỗ Thông
20077 5300 70176 7 The Slumber
23432 33312 81269 1 Hộp sen
23686 40350 82133 2 Sleep Tight
23686 42255 84725 13 Be Delighted
24745 47020 86300 3 Vàng - Size S
24746 47022 86302 1 Vàng (Size S)
24746 47023 86302 1 Vàng (Size S)
24746 47024 86302 1 Vàng (Size S)
24830 47631 86591 2 Sen hồng
24836 47655 86606 1 Mẫu vẽ hoa sen ngẫu nhiên
24996 49164 87185 1 Seigaiha
24997 49169 87191 2 2. Nâu đậm
25008 49230 87232 1 Bộ Ấm Nhỏ