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 = 'en' 
WHERE 
  cscart_images_links.object_type = 'product' 
  AND cscart_images_links.type = 'M' 
  AND cscart_images_links.object_id IN (
    13439, 13467, 13440, 13468, 13441, 13469, 
    13442, 13470, 13443, 13471, 13444, 
    13472, 13445, 13473, 13446, 13474, 
    13447, 13475, 13448, 13476, 18508, 
    18513, 18518, 18509, 18520, 18525, 
    18530, 18521, 18522, 18523, 18524, 
    13449, 13477, 13450, 13478
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00108

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.18888038,
    "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": "range",
              "possible_keys": ["object_id"],
              "key": "object_id",
              "key_length": "81",
              "used_key_parts": ["object_id", "object_type", "type"],
              "loops": 1,
              "rows": 35,
              "cost": 0.08743432,
              "filtered": 100,
              "index_condition": "cscart_images_links.object_type = 'product' and cscart_images_links.`type` = 'M' and cscart_images_links.object_id in (13439,13467,13440,13468,13441,13469,13442,13470,13443,13471,13444,13472,13445,13473,13446,13474,13447,13475,13448,13476,18508,18513,18518,18509,18520,18525,18530,18521,18522,18523,18524,13449,13477,13450,13478)"
            }
          }
        }
      },
      {
        "table": {
          "table_name": "cscart_images",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "4",
          "used_key_parts": ["image_id"],
          "ref": ["u508912950_dev_2025.cscart_images_links.detailed_id"],
          "loops": 35,
          "rows": 1,
          "cost": 0.0411358,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "cscart_common_descriptions",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "108",
          "used_key_parts": ["object_id", "lang_code", "object_holder"],
          "ref": ["u508912950_dev_2025.cscart_images.image_id", "const", "const"],
          "loops": 35,
          "rows": 1,
          "cost": 0.037859,
          "filtered": 100,
          "attached_condition": "trigcond(cscart_common_descriptions.object_holder = 'images' and cscart_common_descriptions.lang_code = 'en' and trigcond(cscart_images.image_id is not null))"
        }
      }
    ]
  }
}

Result

image_id image_path image_x image_y is_high_res transparent pair_id object_id object_type detailed_id type position alt images_image_id
0 mh01-gray_alt1.jpg 1080 1340 N N 29309 18508 product 31064 M 0 31064
0 mh01-gray_alt1.jpg 1080 1340 N N 29310 18509 product 31064 M 0 31064
0 mh01-gray_alt1.jpg 1080 1340 N N 29314 18513 product 31064 M 0 31064
0 mh01-gray_alt1.jpg 1080 1340 N N 29319 18518 product 31064 M 0 31064
0 mh01-gray_alt1_bmp7-7v.jpg 1080 1340 N N 29328 18520 product 31072 M 0 31072
0 mh01-gray_alt1_bmp7-7v.jpg 1080 1340 N N 29329 18521 product 31072 M 0 31072
0 mh01-gray_alt1_bmp7-7v.jpg 1080 1340 N N 29330 18522 product 31072 M 0 31072
0 mh01-gray_alt1_bmp7-7v.jpg 1080 1340 N N 29331 18523 product 31072 M 0 31072
0 mh01-gray_alt1_bmp7-7v.jpg 1080 1340 N N 29332 18524 product 31072 M 0 31072
0 mh01-gray_alt1_bmp7-7v.jpg 1080 1340 N N 29333 18525 product 31072 M 0 31072
0 mh01-gray_alt1_bmp7-7v.jpg 1080 1340 N N 29338 18530 product 31072 M 0 31072
0 bergamot.png 1600 1600 N N 22245 13442 product 24024 M 1 24024
0 bergamot_j3eq-i7.png 1600 1600 N N 22246 13470 product 24025 M 1 24025
0 WhatsApp_Image_2025-04-11_at_13.48.09__1_.jpeg 1600 1600 N N 22247 13443 product 24026 M 1 24026
0 WhatsApp_Image_2025-04-11_at_13.48.09__1__08gg-tt.jpeg 1600 1600 N N 22248 13471 product 24027 M 1 24027
0 black_pepper__1_-min.png 3200 3200 N N 22250 13444 product 24029 M 1 24029
0 black_pepper__1_-min_96m1-8x.png 3200 3200 N N 22251 13472 product 24030 M 1 24030
0 WhatsApp_Image_2025-04-11_at_13.48.09__1__id6e-h8.jpeg 1600 1600 N N 22252 13445 product 24031 M 1 24031
0 WhatsApp_Image_2025-04-11_at_14.30.40.jpeg 1600 1600 N N 22255 13446 product 24034 M 1 24034
0 WhatsApp_Image_2025-04-11_at_14.30.40_a0px-i6.jpeg 1600 1600 N N 22256 13474 product 24035 M 1 24035
0 WhatsApp_Image_2025-04-11_at_14.34.01.jpeg 1600 1600 N N 22257 13447 product 24036 M 1 24036
0 WhatsApp_Image_2025-04-11_at_14.34.01_b818-6q.jpeg 1600 1600 N N 22258 13475 product 24037 M 1 24037
0 WhatsApp_Image_2025-04-11_at_13.48.09__1__fd7a-hh.jpeg 1600 1600 N N 22259 13448 product 24038 M 1 24038
0 WhatsApp_Image_2025-04-11_at_13.48.09__1__hfa2-uw.jpeg 1600 1600 N N 22260 13476 product 24039 M 1 24039
0 WhatsApp_Image_2025-04-11_at_13.43.03__25___1_.png 1600 1600 N N 22264 13449 product 24043 M 1 24043
0 WhatsApp_Image_2025-04-11_at_13.43.03__25___1__zmy3-8g.png 1600 1600 N N 22265 13477 product 24044 M 1 24044
0 WhatsApp_Image_2025-04-11_at_15.17.31.jpeg 1600 1600 N N 22266 13450 product 24045 M 1 24045
0 WhatsApp_Image_2025-04-11_at_15.17.31_q277-p8.jpeg 1600 1600 N N 22267 13478 product 24046 M 1 24046
0 WhatsApp_Image_2025-04-11_at_13.48.09__2_.jpeg 1600 1600 N N 22239 13439 product 24018 M 2 24018
0 WhatsApp_Image_2025-04-11_at_13.48.09__2__x2w6-fo.jpeg 1600 1600 N N 22240 13467 product 24019 M 2 24019
0 WhatsApp_Image_2025-04-11_at_13.47.23.jpeg 1600 1600 N N 22241 13440 product 24020 M 2 24020
0 WhatsApp_Image_2025-04-11_at_13.47.23_5ydh-i8.jpeg 1600 1600 N N 22242 13468 product 24021 M 2 24021
0 WhatsApp_Image_2025-04-11_at_13.47.23__1__7fss-50.jpeg 1600 1600 N N 22244 13469 product 24023 M 2 24023
0 WhatsApp_Image_2025-04-11_at_13.48.09__1__edx4-co.jpeg 1600 1600 N N 22253 13473 product 24032 M 2 24032
0 WhatsApp_Image_2025-04-11_at_13.47.23__1_.jpeg 1600 1600 N N 22243 13441 product 24022 M 3 24022