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 (
    1485, 1552, 1269, 1434, 1567, 1559, 1425, 
    1572, 1161, 1329, 1466, 1479, 1477, 
    1397, 1399, 1398, 1506, 1449, 1545, 
    1546
  ) 
  AND a.status = 'A' 
ORDER BY 
  a.position, 
  a.variant_id

Query time 0.00167

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": 42,
              "filtered": 100,
              "index_condition": "a.option_id in (1485,1552,1269,1434,1567,1559,1425,1572,1161,1329,1466,1479,1477,1397,1399,1398,1506,1449,1545,1546) 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
2826 1161 0 0.000 A 0.000 A 0.000 A A
3745 1398 0 0.000 A 0.000 A 0.000 A A
3747 1399 0 0.000 A 0.000 A 0.000 A A
3805 1425 0 0.000 A 0.000 A 0.000 A A
3821 1434 0 0.000 A 0.000 A 0.000 A A
Viết thiệp 3840 1449 0 0.000 A 0.000 A 0.000 A A
Khắc tên và lời nhắn 16-20 ký tự 3865 1466 0 0.000 A 0.000 A 0.000 A A
3882 1477 0 0.000 A 0.000 A 0.000 A A
3885 1479 0 0.000 A 0.000 A 0.000 A A
Green apple 3894 1485 0 0.000 A 0.000 A 0.000 A A
Flower canvas 3895 1485 0 0.000 A 0.000 A 0.000 A A
Back home 3896 1485 0 0.000 A 0.000 A 0.000 A A
Hộp quà ghi tên (MIỄN PHÍ) 3948 1506 0 0.000 A 0.000 A 0.000 A A
4026 1545 0 0.000 A 0.000 A 0.000 A A
4028 1546 0 0.000 A 0.000 A 0.000 A A
4040 1552 0 0.000 A 0.000 A 0.000 A A
4052 1559 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
2825 1161 1 0.000 A 0.000 A 0.000 A A
Khắc theo yêu cầu: Chữ + logo đơn giản 3349 1269 1 0.000 A 0.000 A 0.000 A A
Nâu vàng 3564 1329 1 0.000 A 0.000 A 0.000 A A
Chữ ký 3739 1397 1 0.000 A 0.000 A 0.000 A A
3744 1398 1 40000.000 A 0.000 A 0.000 A A
3746 1399 1 0.000 A 0.000 A 0.000 A A
3804 1425 1 0.000 A 0.000 A 0.000 A A
3820 1434 1 0.000 A 0.000 A 0.000 A A
3881 1477 1 0.000 A 0.000 A 0.000 A A
3884 1479 1 0.000 A 0.000 A 0.000 A A
4025 1545 1 0.000 A 0.000 A 0.000 A A
4027 1546 1 0.000 A 0.000 A 0.000 A A
4039 1552 1 0.000 A 0.000 A 0.000 A A
4051 1559 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
Mẫu ngẫu nhiên 3350 1269 2 0.000 A 0.000 A 0.000 A A
Nâu đỏ 3565 1329 2 0.000 A 0.000 A 0.000 A A
In hoa nét mảnh 3740 1397 2 0.000 A 0.000 A 0.000 A A
In hoa nét đậm 3741 1397 3 0.000 A 0.000 A 0.000 A A
Khắc ảnh 4098 1269 3 50000.000 A 0.000 A 0.000 A A
Viết tay 3742 1397 4 0.000 A 0.000 A 0.000 A A
Viết thường 3743 1397 5 0.000 A 0.000 A 0.000 A A