SELECT 
  cscart_images.*, 
  cscart_images_links.*, 
  cscart_common_descriptions.description AS alt, 
  cscart_images.image_id AS images_image_id 
FROM 
  cscart_images_links 
  LEFT JOIN cscart_images ON cscart_images_links.detailed_id = cscart_images.image_id 
  LEFT JOIN cscart_common_descriptions ON cscart_common_descriptions.object_id = cscart_images.image_id 
  AND cscart_common_descriptions.object_holder = 'images' 
  AND cscart_common_descriptions.lang_code = 'vi' 
WHERE 
  cscart_images_links.object_type = 'product' 
  AND cscart_images_links.type = 'M' 
  AND cscart_images_links.object_id IN (
    3978, 38779, 18726, 18725, 3977, 36306, 
    49256, 49255, 49254, 49253, 36307, 
    36716, 18293, 18292, 4381, 38781, 18732, 
    3974, 38782, 38780, 2252, 26670, 26671, 
    33709, 33831, 18709, 18708, 3988, 36717, 
    36718, 36719, 43650, 43799, 43800, 
    43801, 43802, 43803, 43804, 43805, 
    2249, 26664, 26665, 40580, 40579, 40578, 
    40577, 40576, 40575, 40535, 25849, 
    25848, 25847, 353, 36295, 36687, 36688, 
    36689, 33721, 34036, 34037, 34038, 
    34039, 34040, 34041, 34042, 34043, 
    34044, 34045, 34046, 34047, 34048, 
    34049, 34050, 34051, 2260, 26684, 26685, 
    36300, 36695, 36696, 40532, 40562, 
    40563, 40564, 40565, 40598, 40597, 
    40527, 40592, 40593, 40594, 40595, 
    40596, 41230, 41242, 41243, 41244, 
    25159, 49308, 46818, 49309, 18723, 
    3979, 36293, 36679, 36680, 36681, 36682, 
    36683, 18712, 18710, 40751, 40750, 
    33835
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00795

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "read_sorted_file": {
          "filesort": {
            "sort_key": "cscart_images_links.position, cscart_images_links.pair_id",
            "table": {
              "table_name": "cscart_images_links",
              "access_type": "ALL",
              "possible_keys": ["object_id"],
              "rows": 125,
              "filtered": 91.19999695,
              "attached_condition": "cscart_images_links.object_type = 'product' and cscart_images_links.`type` = 'M' and cscart_images_links.object_id in (3978,38779,18726,18725,3977,36306,49256,49255,49254,49253,36307,36716,18293,18292,4381,38781,18732,3974,38782,38780,2252,26670,26671,33709,33831,18709,18708,3988,36717,36718,36719,43650,43799,43800,43801,43802,43803,43804,43805,2249,26664,26665,40580,40579,40578,40577,40576,40575,40535,25849,25848,25847,353,36295,36687,36688,36689,33721,34036,34037,34038,34039,34040,34041,34042,34043,34044,34045,34046,34047,34048,34049,34050,34051,2260,26684,26685,36300,36695,36696,40532,40562,40563,40564,40565,40598,40597,40527,40592,40593,40594,40595,40596,41230,41242,41243,41244,25159,49308,46818,49309,18723,3979,36293,36679,36680,36681,36682,36683,18712,18710,40751,40750,33835)"
            }
          }
        }
      },
      {
        "table": {
          "table_name": "cscart_images",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "4",
          "used_key_parts": ["image_id"],
          "ref": ["dev_db.cscart_images_links.detailed_id"],
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "cscart_common_descriptions",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "107",
          "used_key_parts": ["object_id", "lang_code", "object_holder"],
          "ref": ["dev_db.cscart_images.image_id", "const", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(cscart_common_descriptions.object_id = cscart_images.image_id and cscart_common_descriptions.object_holder = 'images' and cscart_common_descriptions.lang_code = 'vi' and trigcond(cscart_images.image_id is not null))"
        }
      }
    ]
  }
}