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 (
    812, 1588, 1589, 1590, 1592, 1294, 1512, 
    702, 1226, 727, 823, 890
  ) 
  AND a.status = 'A' 
ORDER BY 
  a.position, 
  a.variant_id

Query time 0.00310

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": 39,
              "filtered": 100,
              "index_condition": "a.option_id in (812,1588,1589,1590,1592,1294,1512,702,1226,727,823,890) 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
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
2083 890 0 0.000 A 0.000 A 0.000 A A
3183 1226 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
Lemongrass 4123 1588 0 0.000 A 0.000 A 0.000 A A
Cinnamon 4124 1588 0 0.000 A 0.000 A 0.000 A A
Orange Cinnamon  4125 1588 0 0.000 A 0.000 A 0.000 A A
Wood 4126 1588 0 0.000 A 0.000 A 0.000 A A
Happy Birthday  4127 1588 0 0.000 A 0.000 A 0.000 A A
Sweet day  4128 1588 0 0.000 A 0.000 A 0.000 A A
Ylang ylang  4129 1588 0 0.000 A 0.000 A 0.000 A A
Sweet dream  4130 1588 0 0.000 A 0.000 A 0.000 A A
Flowery 4131 1588 0 0.000 A 0.000 A 0.000 A A
Summer tea  4132 1588 0 0.000 A 0.000 A 0.000 A A
Ocean breeze  4133 1588 0 0.000 A 0.000 A 0.000 A A
Rain spa  4134 1588 0 0.000 A 0.000 A 0.000 A A
Lavender 4135 1588 0 0.000 A 0.000 A 0.000 A A
Crystal snow  4136 1588 0 0.000 A 0.000 A 0.000 A A
Santal valley  4137 1588 0 0.000 A 0.000 A 0.000 A A
After rain  4138 1588 0 0.000 A 0.000 A 0.000 A A
Date night  4139 1588 0 0.000 A 0.000 A 0.000 A A
Ador coco  4140 1588 0 0.000 A 0.000 A 0.000 A A
Sexy night 4141 1588 0 0.000 A 0.000 A 0.000 A A
4143 1589 0 0.000 A 0.000 A 0.000 A A
4145 1590 0 0.000 A 0.000 A 0.000 A A
4147 1592 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
Xanh lá đậm 1848 812 1 0.000 A 0.000 A 0.000 A A
Xanh dương 1876 823 1 0.000 A 0.000 A 0.000 A A
2082 890 1 6000.000 A 0.000 A 0.000 A A
3182 1226 1 0.000 A 0.000 A 0.000 A A
Xanh 3472 1294 1 0.000 A 0.000 A 0.000 A A
4142 1589 1 0.000 A 0.000 A 0.000 A A
4144 1590 1 35000.000 A 0.000 A 0.000 A A
4146 1592 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
Tuỳ chỉnh 1877 823 2 0.000 A 0.000 A 0.000 A A
Đỏ 3473 1294 2 0.000 A 0.000 A 0.000 A A