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 (
    1313, 702, 1111, 1139, 1500, 1512, 1249, 
    1301, 724, 1090, 812, 703, 727
  ) 
  AND a.status = 'A' 
ORDER BY 
  a.position, 
  a.variant_id

Query time 0.01106

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": 35,
              "filtered": 100,
              "index_condition": "a.option_id in (1313,702,1111,1139,1500,1512,1249,1301,724,1090,812,703,727) 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
Trắng 1557 724 0 0.000 A 0.000 A 0.000 A A
Vàng 1558 724 0 0.000 A 0.000 A 0.000 A A
Mix trắng nâu 1559 724 0 0.000 A 0.000 A 0.000 A A
Nâu 1565 727 0 0.000 A 0.000 A 0.000 A A
Cam 1566 727 0 0.000 A 0.000 A 0.000 A A
Hồng nhạt 3626 724 0 0.000 A 0.000 A 0.000 A A
Nâu nhạt 3627 724 0 0.000 A 0.000 A 0.000 A A
Xanh da trời 3628 724 0 0.000 A 0.000 A 0.000 A A
Cam 3629 724 0 0.000 A 0.000 A 0.000 A A
Tím 3630 724 0 0.000 A 0.000 A 0.000 A A
Miễn phí gói quà 3958 1512 0 0.000 A 0.000 A 0.000 A A
Hộp quà 1503 702 1 59000.000 A 0.000 A 0.000 A A
Hộp quà 1504 703 1 59000.000 A 0.000 A 0.000 A A
Xanh lá đậm 1848 812 1 0.000 A 0.000 A 0.000 A A
Trắng 2625 1090 1 0.000 A 0.000 A 0.000 A A
Gói quà đơn giản: Gói hộp kèm nơ 2688 1111 1 25000.000 A 0.000 A 0.000 A A
Nến có trang trí hoa khô 2765 1139 1 35000.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
Không trang trí hoa 3486 1301 1 0.000 A 0.000 A 0.000 A A
Gói quà (MIỄN PHÍ) 3521 1313 1 0.000 A 0.000 A 0.000 A A
Orange Cinnamon 3930 1500 1 0.000 A 0.000 A 0.000 A A
Xanh lá nhạt 1849 812 2 0.000 A 0.000 A 0.000 A A
Nâu 2626 1090 2 0.000 A 0.000 A 0.000 A A
Gói quà chân tình: Gói quà, trang trí hoa và thiệp 2689 1111 2 60000.000 A 0.000 A 0.000 A A
Nến thường 2766 1139 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
Trang trí hoa 3487 1301 2 30000.000 A 0.000 A 0.000 A A
Sweet Dream 3931 1500 2 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
Lavender 3932 1500 3 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
Charming Amber 3933 1500 4 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
Santal Valley 4220 1500 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