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 (
    1559, 893, 1480, 894, 446, 1249, 1226, 
    530
  ) 
  AND a.status = 'A' 
ORDER BY 
  a.position, 
  a.variant_id

Query time 0.00332

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": 24,
              "filtered": 100,
              "index_condition": "a.option_id in (1559,893,1480,894,446,1249,1226,530) 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
Ống hút tre 539 446 0 6000.000 A 0.000 A 0.000 A A
Muỗng tre 540 446 0 30000.000 A 0.000 A 0.000 A A
Đế lót gỗ 541 446 0 35000.000 A 0.000 A 0.000 A A
Gói quà kèm thiệp 659 530 0 50000.000 A 0.000 A 0.000 A A
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
3183 1226 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
Phin cà phê màu cam 2092 894 1 0.000 A 0.000 A 0.000 A A
3182 1226 1 0.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
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
Phin cà phê màu hồng 2093 894 2 0.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
Phin cà phê màu đỏ 2094 894 3 0.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
Phin cà phê màu đen 2095 894 4 0.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
Charm bạc bàn tay 3237 1249 5 200000.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