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 (
    336, 337, 338, 339, 334, 335, 329, 331, 
    318, 330, 12, 325, 326, 317, 319, 320, 
    321, 322, 323, 300, 303, 304, 305, 306, 
    307, 308, 309, 310, 311, 312, 313, 314, 
    315, 316, 289, 297, 298, 299, 287, 278, 
    280, 282, 279, 281, 283, 284
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00155

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "329.21"
    },
    "ordering_operation": {
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "59.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": 59,
            "rows_produced_per_join": 59,
            "filtered": "100.00",
            "index_condition": "((`atulecarter_atul_demo1`.`cscart_images_links`.`object_type` = 'product') and (`atulecarter_atul_demo1`.`cscart_images_links`.`type` = 'M') and (`atulecarter_atul_demo1`.`cscart_images_links`.`object_id` in (336,337,338,339,334,335,329,331,318,330,12,325,326,317,319,320,321,322,323,300,303,304,305,306,307,308,309,310,311,312,313,314,315,316,289,297,298,299,287,278,280,282,279,281,283,284)))",
            "cost_info": {
              "read_cost": "116.81",
              "eval_cost": "11.80",
              "prefix_cost": "128.61",
              "data_read_per_join": "5K"
            },
            "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": [
              "atulecarter_atul_demo1.cscart_images_links.detailed_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 59,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "59.00",
              "eval_cost": "11.80",
              "prefix_cost": "199.41",
              "data_read_per_join": "45K"
            },
            "used_columns": [
              "image_id",
              "image_path",
              "image_x",
              "image_y",
              "is_high_res"
            ]
          }
        },
        {
          "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": [
              "atulecarter_atul_demo1.cscart_images.image_id",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 59,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "59.00",
              "eval_cost": "11.80",
              "prefix_cost": "270.21",
              "data_read_per_join": "35K"
            },
            "used_columns": [
              "object_id",
              "description",
              "lang_code",
              "object_holder"
            ]
          }
        }
      ]
    }
  }
}

Result

image_id image_path image_x image_y is_high_res pair_id object_id object_type detailed_id type position alt images_image_id
0 173283_0113298267324f438bac97eaf.jpg 500 500 N 823 12 product 879 M 0 879
0 t-6.jpg 400 543 N 1160 278 product 1397 M 0 1397
0 t-3.jpg 400 543 N 1161 279 product 1398 M 0 1398
0 t-4.jpg 2300 2415 N 1164 280 product 1401 M 0 1401
0 t-2.jpg 2300 2415 N 1167 281 product 1404 M 0 1404
0 t-7.jpg 1500 1500 N 1168 282 product 1405 M 0 1405
0 t-5.jpg 1500 1500 N 1169 283 product 1406 M 0 1406
0 t-5.jpg 1500 1500 N 1171 284 product 1406 M 0 1406
0 X41185_01.jpg 500 500 N 6624 287 product 252 M 0 252
0 Screenshot_2025-08-21_111813.png 1384 686 N 6670 289 product 8679 M 0 8679
0 Screenshot_2025-08-21_111813.png 1384 686 N 6671 297 product 8679 M 0 8679
0 Screenshot_2025-08-21_111813.png 1384 686 N 6672 298 product 8679 M 0 8679
0 Screenshot_2025-08-21_111813.png 1384 686 N 6673 299 product 8679 M 0 8679
0 63.jpg 1024 683 N 6710 300 product 8716 M 0 8716
0 63.jpg 1024 683 N 6713 303 product 8716 M 0 8716
0 63.jpg 1024 683 N 6714 304 product 8716 M 0 8716
0 63.jpg 1024 683 N 6715 305 product 8716 M 0 8716
0 63.jpg 1024 683 N 6716 306 product 8716 M 0 8716
0 63.jpg 1024 683 N 6717 307 product 8716 M 0 8716
0 63.jpg 1024 683 N 6718 308 product 8716 M 0 8716
0 63.jpg 1024 683 N 6719 309 product 8716 M 0 8716
0 63.jpg 1024 683 N 6720 310 product 8716 M 0 8716
0 63.jpg 1024 683 N 6721 311 product 8716 M 0 8716
0 63.jpg 1024 683 N 6722 312 product 8716 M 0 8716
0 63.jpg 1024 683 N 6723 313 product 8716 M 0 8716
0 63.jpg 1024 683 N 6724 314 product 8716 M 0 8716
0 63.jpg 1024 683 N 6725 315 product 8716 M 0 8716
0 63.jpg 1024 683 N 6726 316 product 8716 M 0 8716
0 85_wixg-l7.jpg 1024 654 N 6727 317 product 8719 M 0 8719
0 82_ipd5-2m.jpg 1024 638 N 6728 318 product 8720 M 0 8720
0 85_wixg-l7.jpg 1024 654 N 6729 319 product 8719 M 0 8719
0 85_wixg-l7.jpg 1024 654 N 6730 320 product 8719 M 0 8719
0 85_wixg-l7.jpg 1024 654 N 6731 321 product 8719 M 0 8719
0 85_wixg-l7.jpg 1024 654 N 6732 322 product 8719 M 0 8719
0 85_wixg-l7.jpg 1024 654 N 6733 323 product 8719 M 0 8719
0 173283_0113298267324f438bac97eaf.jpg 500 500 N 6736 325 product 879 M 0 879
0 173283_0113298267324f438bac97eaf.jpg 500 500 N 6737 326 product 879 M 0 879
0 82_ipd5-2m.jpg 1024 638 N 6740 329 product 8720 M 0 8720
0 82_ipd5-2m.jpg 1024 638 N 6741 330 product 8720 M 0 8720
0 82_ipd5-2m.jpg 1024 638 N 6742 331 product 8720 M 0 8720