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 (
    16819, 
    16818, 
    5455, 
    15700, 
    15699, 
    15698, 
    15697, 
    15696, 
    15695, 
    15694, 
    5958, 
    16781, 
    16780, 
    16779, 
    16778, 
    16777, 
    5476, 
    18244, 
    4465, 
    18334, 
    18333, 
    18332, 
    4362, 
    15693, 
    15692, 
    15691, 
    15690, 
    15689, 
    15688, 
    15687, 
    15686, 
    15685, 
    5959, 
    16791, 
    16790, 
    16789, 
    16788, 
    16787, 
    5472, 
    16813, 
    16812, 
    16811, 
    16810, 
    5462, 
    16776, 
    16775, 
    16774, 
    16773, 
    5478, 
    15709, 
    15708, 
    15707, 
    15706, 
    15705, 
    15704, 
    15703, 
    15702, 
    15701, 
    5957, 
    15677, 
    15676, 
    15675, 
    15674, 
    15673, 
    15672, 
    15671, 
    15670, 
    15669, 
    5961, 
    16802, 
    16801, 
    16800, 
    16799, 
    16798, 
    16797, 
    5467, 
    16826, 
    16825, 
    16824, 
    16823, 
    16822, 
    5448, 
    18331, 
    18330, 
    18329, 
    18328, 
    18327, 
    4363, 
    15716, 
    15715, 
    15714, 
    15713, 
    15712, 
    15711, 
    15710, 
    5956, 
    18337, 
    18336, 
    18335, 
    4361, 
    16821, 
    16820, 
    5451, 
    18320, 
    4366, 
    16772, 
    16771, 
    16770, 
    16769, 
    16768, 
    5479, 
    18338, 
    4360, 
    16757, 
    16756, 
    16755, 
    16754, 
    5485, 
    15662, 
    15661, 
    15660, 
    15659, 
    5963, 
    16831, 
    16830, 
    16829, 
    16828, 
    16827, 
    5447, 
    18323, 
    18322, 
    18321, 
    4365, 
    18241, 
    18240, 
    18239, 
    18238, 
    4468, 
    16796, 
    16795, 
    16794, 
    16793, 
    16792, 
    5469
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00687

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": 110,
              "filtered": 100,
              "attached_condition": "cscart_images_links.object_type = 'product' and cscart_images_links.`type` = 'M' and cscart_images_links.object_id in (16819,16818,5455,15700,15699,15698,15697,15696,15695,15694,5958,16781,16780,16779,16778,16777,5476,18244,4465,18334,18333,18332,4362,15693,15692,15691,15690,15689,15688,15687,15686,15685,5959,16791,16790,16789,16788,16787,5472,16813,16812,16811,16810,5462,16776,16775,16774,16773,5478,15709,15708,15707,15706,15705,15704,15703,15702,15701,5957,15677,15676,15675,15674,15673,15672,15671,15670,15669,5961,16802,16801,16800,16799,16798,16797,5467,16826,16825,16824,16823,16822,5448,18331,18330,18329,18328,18327,4363,15716,15715,15714,15713,15712,15711,15710,5956,18337,18336,18335,4361,16821,16820,5451,18320,4366,16772,16771,16770,16769,16768,5479,18338,4360,16757,16756,16755,16754,5485,15662,15661,15660,15659,5963,16831,16830,16829,16828,16827,5447,18323,18322,18321,4365,18241,18240,18239,18238,4468,16796,16795,16794,16793,16792,5469)"
            }
          }
        }
      },
      {
        "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))"
        }
      }
    ]
  }
}