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 (
    5999, 5997, 5998, 6000, 6001, 6002, 6007, 
    6008, 6009, 6010, 6011, 6012, 6003, 
    6004, 6005, 6019, 6020, 6021, 6022, 
    6023, 6013, 6014, 6015, 5979, 5980, 
    5981, 5982, 5984, 6221
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00243

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "69.61"
    },
    "ordering_operation": {
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "29.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": 29,
            "rows_produced_per_join": 29,
            "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 (5999,5997,5998,6000,6001,6002,6007,6008,6009,6010,6011,6012,6003,6004,6005,6019,6020,6021,6022,6023,6013,6014,6015,5979,5980,5981,5982,5984,6221)))",
            "cost_info": {
              "read_cost": "17.41",
              "eval_cost": "2.90",
              "prefix_cost": "20.31",
              "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": 29,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "7.25",
              "eval_cost": "2.90",
              "prefix_cost": "30.46",
              "data_read_per_join": "22K"
            },
            "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": 29,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "7.25",
              "eval_cost": "2.90",
              "prefix_cost": "40.61",
              "data_read_per_join": "17K"
            },
            "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 cc_-_2025-09-29T210617.005.jpg 600 600 N N Y 27764 5979 product 21099 M 0 21099
0 cc_-_2025-09-29T211005.014.jpg 600 600 N N Y 27772 5980 product 21102 M 0 21102
0 cc_-_2025-09-29T224224.767.jpg 600 600 N N Y 27776 5981 product 21105 M 0 21105
0 cc_-_2025-09-29T225121.914.jpg 600 600 N N Y 27795 5982 product 21110 M 0 21110
0 cc_-_2025-09-29T235039.112.jpg 600 600 N N Y 27836 5984 product 21120 M 0 21120
0 cc_-_2025-09-30T210642.331.jpg 600 600 N N Y 27916 5997 product 21176 M 0 21176
0 cc_-_2025-09-30T211012.600.jpg 600 600 N N Y 27933 6000 product 21180 M 0 21180
0 cc_-_2025-09-30T210814.157.jpg 600 600 N N Y 27944 6001 product 21178 M 0 21178
0 cc_-_2025-09-30T210357.131.jpg 600 600 N N Y 27956 5998 product 21174 M 0 21174
0 cc_-_2025-09-30T203853.784.jpg 600 600 N N Y 27967 5999 product 21172 M 0 21172
0 cc_-_2025-09-30T211438.199.jpg 600 600 N N Y 27985 6002 product 21184 M 0 21184
0 cc_-_2025-09-30T222143.100.jpg 600 600 N N Y 27997 6003 product 21187 M 0 21187
0 cc_-_2025-09-30T222324.179.jpg 600 600 N N Y 28006 6004 product 21189 M 0 21189
0 cc_-_2025-09-30T220717.477.jpg 600 600 N N Y 28011 6005 product 21191 M 0 21191
0 cc_-_2025-10-01T001032.512.jpg 600 600 N N Y 28016 6007 product 21194 M 0 21194
0 cc_-_2025-10-01T001302.856.jpg 600 600 N N Y 28033 6008 product 21196 M 0 21196
0 cc_-_2025-10-01T001736.618.jpg 600 600 N N Y 28046 6011 product 21198 M 0 21198
0 cc_-_2025-10-01T001709.248.jpg 600 600 N N Y 28054 6009 product 21200 M 0 21200
0 cc_-_2025-10-01T002140.622.jpg 600 600 N N Y 28067 6012 product 21202 M 0 21202
0 cc_-_2025-10-01T002132.549.jpg 600 600 N N Y 28075 6010 product 21204 M 0 21204
0 cc_-_2025-10-01T005817.999.jpg 600 600 N N Y 28088 6013 product 21206 M 0 21206
0 cc_-_2025-10-01T005825.939.jpg 600 600 N N Y 28096 6014 product 21208 M 0 21208
0 cc_-_2025-10-01T005809.461.jpg 600 600 N N Y 28101 6015 product 21210 M 0 21210
0 cc_-_2025-10-01T111650.149.jpg 600 600 N N Y 28112 6019 product 21218 M 0 21218
0 cc_-_2025-10-01T111714.903.jpg 600 600 N N Y 28126 6020 product 21220 M 0 21220
0 cc_-_2025-10-01T111642.994.jpg 600 600 N N Y 28135 6021 product 21222 M 0 21222
0 cc_-_2025-10-01T111634.929.jpg 600 600 N N Y 28144 6022 product 21224 M 0 21224
0 cc_-_2025-10-01T111659.993.jpg 600 600 N N Y 28153 6023 product 21226 M 0 21226
0 cc_-_2025-10-06T004428.484.jpg 600 600 N N Y 29435 6221 product 21569 M 0 21569