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 (
    4975, 4974, 4998, 4995, 5039, 5038, 4991, 
    5346, 11310, 5309, 5331, 5332, 11255, 
    11257, 11258, 11275, 11276, 11277, 
    11278, 11279, 11280, 11281, 10413, 
    10412, 11223, 11222
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00177

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "64.56"
    },
    "ordering_operation": {
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "27.00"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_images_links",
            "access_type": "range",
            "possible_keys": [
              "object_id"
            ],
            "key": "object_id",
            "used_key_parts": [
              "object_id",
              "object_type",
              "type"
            ],
            "key_length": "81",
            "rows_examined_per_scan": 27,
            "rows_produced_per_join": 27,
            "filtered": "100.00",
            "index_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`cscart_images_links`.`object_type` = 'product') and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_images_links`.`type` = 'M') and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_images_links`.`object_id` in (4975,4974,4998,4995,5039,5038,4991,5346,11310,5309,5331,5332,11255,11257,11258,11275,11276,11277,11278,11279,11280,11281,10413,10412,11223,11222)))",
            "cost_info": {
              "read_cost": "15.96",
              "eval_cost": "2.70",
              "prefix_cost": "18.66",
              "data_read_per_join": "2K"
            },
            "used_columns": [
              "pair_id",
              "object_id",
              "object_type",
              "image_id",
              "detailed_id",
              "type",
              "position"
            ]
          }
        },
        {
          "table": {
            "table_name": "cscart_images",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "image_id"
            ],
            "key_length": "4",
            "ref": [
              "softwarepirmam_hewadelivard_cscart_4.cscart_images_links.detailed_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 27,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "6.75",
              "eval_cost": "2.70",
              "prefix_cost": "28.11",
              "data_read_per_join": "20K"
            },
            "used_columns": [
              "image_id",
              "image_path",
              "image_x",
              "image_y",
              "is_high_res",
              "transparent",
              "cp_in_opt_list"
            ]
          }
        },
        {
          "table": {
            "table_name": "cscart_common_descriptions",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "object_id",
              "lang_code",
              "object_holder"
            ],
            "key_length": "108",
            "ref": [
              "softwarepirmam_hewadelivard_cscart_4.cscart_images.image_id",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 27,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "6.75",
              "eval_cost": "2.70",
              "prefix_cost": "37.56",
              "data_read_per_join": "16K"
            },
            "used_columns": [
              "object_id",
              "description",
              "lang_code",
              "object_holder"
            ]
          }
        }
      ]
    }
  }
}

Result

image_id image_path image_x image_y is_high_res transparent cp_in_opt_list pair_id object_id object_type detailed_id type position alt images_image_id
0 Delivard_Template_jvhk-56.jpg 900 900 N N Y 24512 4991 product 18405 M 0 18405
0 Delivard_Template_i374-0t.jpg 900 900 N N Y 24538 4995 product 18423 M 0 18423
0 cc__9__6fnk-an.jpg 600 600 N N Y 25405 5309 product 19223 M 0 19223
0 cc__7__mxix-ii.jpg 600 600 N N Y 25413 5331 product 19225 M 0 19225
0 cc__6__mshu-hc.jpg 600 600 N N Y 25418 5332 product 19227 M 0 19227
0 cc__11__dp6b-jp.jpg 600 600 N N Y 25441 5346 product 19243 M 0 19243
0 198_l700-0a.jpg 600 600 N N N 41375 10412 product 31944 M 0 31944
0 199_ten2-he.jpg 600 600 N N N 41377 10413 product 31945 M 0 31945
0 cc_-_2026-01-24T002240.839.jpg 600 600 N N N 44396 11222 product 34536 M 0 34536
0 cc_-_2026-01-24T002429.201.jpg 600 600 N N N 44404 11223 product 34539 M 0 34539
0 cc_-_2026-01-24T182800.668.jpg 600 600 N N N 44652 11275 product 34756 M 0 34756
0 cc_-_2026-01-24T195422.375.jpg 600 600 N N N 44700 11279 product 34768 M 0 34768
0 cc_-_2026-01-25T104946.557.jpg 600 600 N N N 44878 11310 product 34896 M 0 34896
0 image_2026-01-26_231605181.png 600 600 N N N 45219 11257 product 35138 M 0 35138
0 image_2026-01-26_231715426.png 600 600 N N N 45220 11255 product 35139 M 0 35139
0 image_2026-01-26_231816162.png 600 600 N N N 45221 11258 product 35140 M 0 35140
0 Delivard_Template_6ek2-nw.jpg 900 900 N N Y 24477 4975 product 18381 M 1 18381
0 Delivard_Template_q1zu-x9.jpg 900 900 N N Y 24479 4974 product 18383 M 1 18383
0 cc_-_2026-01-24T194100.842.jpg 600 600 N N N 44706 11280 product 34770 M 2 34770
0 cc_-_2026-01-24T183205.407.jpg 600 600 N N N 44672 11278 product 34759 M 3 34759
0 Delivard_Template_7d7d-4c.jpg 900 900 N N Y 24547 4998 product 18428 M 4 18428
0 Delivard_Template__1_.jpg 900 900 N N Y 24795 5038 product 18664 M 4 18664
0 cc_-_2026-01-24T201408.365.jpg 600 600 N N N 44713 11281 product 34772 M 5 34772
0 cc_-_2026-01-24T184347.979.jpg 600 600 N N N 44679 11276 product 34762 M 6 34762
0 Delivard_Template__5_.jpg 900 900 N N Y 24799 5039 product 18668 M 7 18668
0 cc_-_2026-01-24T184923.412.jpg 600 600 N N N 44689 11277 product 34765 M 9 34765