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 (
    42361, 41130, 41131, 23462, 23461, 23460, 
    23459, 1306, 23466, 23465, 23464, 23463, 
    1305, 18151, 18150, 18149, 18148, 4785, 
    37881, 42358, 41144, 41145, 18134, 
    18133, 18132, 18131, 18130, 4795, 42359, 
    41124, 41125, 18143, 18142, 18141, 
    18140, 4789, 20837, 20836, 20835, 20834, 
    20833, 20832, 20831, 20830, 2628, 41423, 
    41459, 41460, 41461, 42344, 41134, 
    41135, 18147, 18146, 18145, 18144, 
    4787, 18139, 18138, 18137, 18136, 18135, 
    4793, 42343, 41102, 41103, 41428, 41475, 
    41476, 41477, 41424, 41462, 41463, 
    41464, 22533, 22532, 22531, 22530, 
    1840, 18123, 18122, 18121, 18120, 4803, 
    42348, 41138, 41139, 41427, 41472, 
    41473, 41474, 18124, 4801, 18126, 18125, 
    4799, 20849, 20848, 20847, 20846, 20845, 
    2625, 18129, 18128, 18127, 4797, 41426, 
    41468, 41469, 41470, 41471, 41104, 
    37895, 41105, 19200, 19199, 19198, 
    19197, 19196, 19195
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.01376

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": 96,
              "attached_condition": "cscart_images_links.object_type = 'product' and cscart_images_links.`type` = 'M' and cscart_images_links.object_id in (42361,41130,41131,23462,23461,23460,23459,1306,23466,23465,23464,23463,1305,18151,18150,18149,18148,4785,37881,42358,41144,41145,18134,18133,18132,18131,18130,4795,42359,41124,41125,18143,18142,18141,18140,4789,20837,20836,20835,20834,20833,20832,20831,20830,2628,41423,41459,41460,41461,42344,41134,41135,18147,18146,18145,18144,4787,18139,18138,18137,18136,18135,4793,42343,41102,41103,41428,41475,41476,41477,41424,41462,41463,41464,22533,22532,22531,22530,1840,18123,18122,18121,18120,4803,42348,41138,41139,41427,41472,41473,41474,18124,4801,18126,18125,4799,20849,20848,20847,20846,20845,2625,18129,18128,18127,4797,41426,41468,41469,41470,41471,41104,37895,41105,19200,19199,19198,19197,19196,19195)"
            }
          }
        }
      },
      {
        "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))"
        }
      }
    ]
  }
}