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 (
    13876, 13877, 13878, 13879, 13880, 13881, 
    13882, 13899, 13900, 13901, 13861, 
    13862, 13863, 13864, 13865, 13897, 
    13898, 13866, 13867, 13868, 13869, 
    13873, 13874, 13875, 13885, 13886, 
    13887, 13888, 13883, 13884
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00047

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.167593244,
    "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": 30,
              "cost": 0.07833352,
              "filtered": 100,
              "index_condition": "cscart_images_links.object_type = 'product' and cscart_images_links.`type` = 'M' and cscart_images_links.object_id in (13876,13877,13878,13879,13880,13881,13882,13899,13900,13901,13861,13862,13863,13864,13865,13897,13898,13866,13867,13868,13869,13873,13874,13875,13885,13886,13887,13888,13883,13884)"
            }
          }
        }
      },
      {
        "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": 30,
          "rows": 1,
          "cost": 0.0366636,
          "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": 30,
          "rows": 1,
          "cost": 0.0333868,
          "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 aden_cream_foundation_05_-fudge_15-ml-1.jpg 1000 1000 N N 21372 13861 product 23157 M 0 23157
0 aden_cream_foundation_02_natural_15-ml-1.jpg 1000 1000 N N 21373 13862 product 23158 M 0 23158
0 aden_cream_foundation_01_nude_15-ml-1.jpg 1000 1000 N N 21374 13863 product 23159 M 0 23159
0 aden_cream_foundation_03_terra_cotta_15-ml-1.jpg 1000 1000 N N 21375 13864 product 23160 M 0 23160
0 aden_cream_foundation_07_-porcelain_15-ml.jpg 1000 1000 N N 21376 13865 product 23161 M 0 23161
0 aden_full_hd_fluid_foundation_01_white.jpg 1000 1000 N N 21377 13866 product 23162 M 0 23162
0 aden_full_hd_fluid_foundation_01_white_t5sm-xo.jpg 1000 1000 N N 21381 13867 product 23166 M 0 23166
0 aden_full_hd_fluid_foundation_01_white_acql-tl.jpg 1000 1000 N N 21385 13868 product 23170 M 0 23170
0 aden_full_hd_fluid_foundation_01_white_gk4f-tp.jpg 1000 1000 N N 21389 13869 product 23174 M 0 23174
0 Liquid-concealer-03-scaled.jpg 2560 2560 N N 21402 13873 product 23187 M 0 23187
0 Liquid-concealer-03-scaled_gysv-rx.jpg 2560 2560 N N 21405 13874 product 23190 M 0 23190
0 Liquid-concealer-03-scaled_7iab-45.jpg 2560 2560 N N 21408 13875 product 23193 M 0 23193
0 aden_bb_krem_01_300-scaled_y675-1r.jpg 2560 2560 N N 21424 13878 product 23209 M 0 23209
0 bb-cream-collagen.png 4000 4000 N N 21429 13879 product 23214 M 0 23214
0 bb-cream-collagen_8wr9-ja.png 4000 4000 N N 21435 13880 product 23220 M 0 23220
0 bb-cream-collagen_l6bz-z9.png 4000 4000 N N 21441 13881 product 23226 M 0 23226
0 bb-cream-collagen_3xpk-e5.png 4000 4000 N N 21447 13882 product 23232 M 0 23232
0 aden_silky_matt_compact_powder_01_v2.jpg 1000 1000 N N 21453 13883 product 23238 M 0 23238
0 aden_silky_matt_compact_powder_01_v2_c2z7-st.jpg 1000 1000 N N 21455 13884 product 23240 M 0 23240
0 aden_powder_pearls_03.jpg 1000 1000 N N 21457 13885 product 23242 M 0 23242
0 aden_powder_pearls_04.jpg 1000 1000 N N 21458 13886 product 23243 M 0 23243
0 aden_powder_pearls_05.jpg 1000 1000 N N 21459 13887 product 23244 M 0 23244
0 aden_powder_pearls_02.jpg 1000 1000 N N 21460 13888 product 23245 M 0 23245
0 ADEN-Face-Sunlight-Trio-Spring1000.jpg 1000 1000 N N 21487 13897 product 23272 M 0 23272
0 ADEN-Face-Sunlight-Trio-Summer1000.jpg 1000 1000 N N 21488 13898 product 23273 M 0 23273
0 aden_cream_camouflage_04_dark_35-gr-.jpg 1000 1000 N N 21489 13899 product 23274 M 0 23274
0 aden_cream_camouflage_02_fair_35-gr.jpg 1000 1000 N N 21490 13900 product 23275 M 0 23275
0 aden_cream_camouflage_01_light_35-gr.jpg 1000 1000 N N 21491 13901 product 23276 M 0 23276
0 aden_bb_krem_02-300-scaled_84a1-q3.jpg 2560 2560 N N 21683 13877 product 23468 M 0 23468
0 aden_bb_krem_03_300-scaled_4wfs-09.jpg 2560 2560 N N 22011 13876 product 23796 M 0 23796