SELECT 
  b.variant_name, 
  a.* 
FROM 
  cscart_product_option_variants AS a 
  LEFT JOIN cscart_product_option_variants_descriptions AS b ON b.variant_id = a.variant_id 
  AND b.lang_code = 'vi' 
WHERE 
  1 
  AND a.option_id IN (
    1566, 1580, 1480, 1158, 1434, 1567, 1559, 
    1572, 893, 1135, 1136, 1248, 1249
  ) 
  AND a.status = 'A' 
ORDER BY 
  a.position, 
  a.variant_id

Query time 0.00326

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "read_sorted_file": {
          "filesort": {
            "sort_key": "a.position, a.variant_id",
            "table": {
              "table_name": "a",
              "access_type": "range",
              "possible_keys": ["status", "option_id", "option_id_2"],
              "key": "option_id",
              "key_length": "6",
              "used_key_parts": ["option_id", "status"],
              "rows": 50,
              "filtered": 100,
              "index_condition": "a.option_id in (1566,1580,1480,1158,1434,1567,1559,1572,893,1135,1136,1248,1249) and a.`status` = 'A'"
            }
          }
        }
      },
      {
        "table": {
          "table_name": "b",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "9",
          "used_key_parts": ["variant_id", "lang_code"],
          "ref": ["dev_db.a.variant_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(b.lang_code = 'vi')"
        }
      }
    ]
  }
}

Result

variant_name variant_id option_id position modifier modifier_type weight_modifier weight_modifier_type point_modifier point_modifier_type status
Hồng 2088 893 0 0.000 A 0.000 A 0.000 A A
Cam 2089 893 0 0.000 A 0.000 A 0.000 A A
Đỏ 2090 893 0 0.000 A 0.000 A 0.000 A A
Đen 2091 893 0 0.000 A 0.000 A 0.000 A A
3821 1434 0 0.000 A 0.000 A 0.000 A A
3887 1480 0 0.000 A 0.000 A 0.000 A A
4052 1559 0 0.000 A 0.000 A 0.000 A A
4066 1566 0 0.000 A 0.000 A 0.000 A A
4068 1567 0 0.000 A 0.000 A 0.000 A A
4088 1572 0 0.000 A 0.000 A 0.000 A A
Giấy craft hoa khô 4105 1580 0 49000.000 A 0.000 A 0.000 A A
Giấy craft tag vải 4106 1580 0 79000.000 A 0.000 A 0.000 A A
ARABICA 500gr 2757 1135 1 0.000 A 0.000 A 0.000 A A
Cà phê xay 2759 1136 1 30000.000 A 0.000 A 0.000 A A
Nâu tan 2818 1158 1 0.000 A 0.000 A 0.000 A A
Charm bạc tròn trắng chữ 3227 1248 1 200000.000 A 0.000 A 0.000 A A
Charm bạc tròn trắng chữ 3233 1249 1 200000.000 A 0.000 A 0.000 A A
3820 1434 1 0.000 A 0.000 A 0.000 A A
3886 1480 1 0.000 A 0.000 A 0.000 A A
4051 1559 1 0.000 A 0.000 A 0.000 A A
4065 1566 1 0.000 A 0.000 A 0.000 A A
4067 1567 1 0.000 A 0.000 A 0.000 A A
4087 1572 1 40000.000 A 0.000 A 0.000 A A
ROBUSTA & ARABICA BLEND 500gr 2758 1135 2 0.000 A 0.000 A 0.000 A A
Cà phê hạt 2760 1136 2 0.000 A 0.000 A 0.000 A A
Nâu nhạt 2819 1158 2 0.000 A 0.000 A 0.000 A A
Charm bạc Phật trắng 3228 1248 2 400000.000 A 0.000 A 0.000 A A
Charm bạc Phật trắng 3234 1249 2 400000.000 A 0.000 A 0.000 A A
Nâu vừa 2820 1158 3 0.000 A 0.000 A 0.000 A A
Charm bạc Phật vàng 3229 1248 3 400000.000 A 0.000 A 0.000 A A
Charm bạc Phật vàng 3235 1249 3 400000.000 A 0.000 A 0.000 A A
Charm bạc tròn xanh đỏ 3230 1248 4 200000.000 A 0.000 A 0.000 A A
Charm bạc tròn xanh đỏ 3236 1249 4 200000.000 A 0.000 A 0.000 A A
Nâu đậm 3608 1158 4 0.000 A 0.000 A 0.000 A A
Không thêm charm 3231 1248 5 0.000 A 0.000 A 0.000 A A
Charm bạc bàn tay 3237 1249 5 200000.000 A 0.000 A 0.000 A A
Nâu Mahogany 3609 1158 5 0.000 A 0.000 A 0.000 A A
Không thêm charm 3238 1249 6 0.000 A 0.000 A 0.000 A A
Nâu Socola 3610 1158 6 0.000 A 0.000 A 0.000 A A
Be 3611 1158 7 0.000 A 0.000 A 0.000 A A
Cam 3612 1158 8 0.000 A 0.000 A 0.000 A A
Vàng 3613 1158 9 0.000 A 0.000 A 0.000 A A
Đỏ 3614 1158 10 0.000 A 0.000 A 0.000 A A
Đỏ sẫm 3615 1158 11 0.000 A 0.000 A 0.000 A A
Xanh ngọc lam 3616 1158 12 0.000 A 0.000 A 0.000 A A
Xanh đậm Navy 3617 1158 13 0.000 A 0.000 A 0.000 A A
Tím 3618 1158 14 0.000 A 0.000 A 0.000 A A
Xanh lá Kelly 3619 1158 15 0.000 A 0.000 A 0.000 A A
Xanh lá 3620 1158 16 0.000 A 0.000 A 0.000 A A
Xanh dương Aqua.G 3621 1158 17 0.000 A 0.000 A 0.000 A A