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 = 'ar' 
WHERE 
  cscart_images_links.object_type = 'product' 
  AND cscart_images_links.type = 'M' 
  AND cscart_images_links.object_id IN (
    5504, 5505, 5506, 5507, 6749, 6750, 6185, 
    6186, 6114, 6115, 5647, 5648, 6146, 
    6147, 6187, 6188, 5651, 5654, 6300, 
    6299, 6081, 6082, 5644, 5645, 6297, 
    6298, 6304, 6303, 6306, 6305
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00192

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "72.01"
    },
    "ordering_operation": {
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "30.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": 30,
            "rows_produced_per_join": 30,
            "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 (5504,5505,5506,5507,6749,6750,6185,6186,6114,6115,5647,5648,6146,6147,6187,6188,5651,5654,6300,6299,6081,6082,5644,5645,6297,6298,6304,6303,6306,6305)))",
            "cost_info": {
              "read_cost": "18.01",
              "eval_cost": "3.00",
              "prefix_cost": "21.01",
              "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": 30,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "7.50",
              "eval_cost": "3.00",
              "prefix_cost": "31.51",
              "data_read_per_join": "23K"
            },
            "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": 30,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "7.50",
              "eval_cost": "3.00",
              "prefix_cost": "42.01",
              "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 Delivard_5gix-bs.jpg 900 900 N N Y 25907 5504 product 19699 M 0 19699
0 Delivard_5gix-bs.jpg 900 900 N N Y 25908 5505 product 19699 M 0 19699
0 Delivard_62fn-ya.jpg 900 900 N N Y 25909 5506 product 19700 M 0 19700
0 Delivard_62fn-ya.jpg 900 900 N N Y 25910 5507 product 19700 M 0 19700
0 Delivard_087m-1p.jpg 900 900 N N Y 26180 5644 product 19921 M 0 19921
0 Delivard_087m-1p.jpg 900 900 N N Y 26181 5645 product 19921 M 0 19921
0 Delivard_0r00-o7.jpg 900 900 N N Y 26183 5647 product 19923 M 0 19923
0 Delivard_0r00-o7.jpg 900 900 N N Y 26184 5648 product 19923 M 0 19923
0 Delivard_n6s4-ua.jpg 900 900 N N Y 26188 5651 product 19927 M 0 19927
0 Delivard_n6s4-ua.jpg 900 900 N N Y 26193 5654 product 19927 M 0 19927
0 1_h8i6-pg.jpg 600 600 N N Y 28442 6081 product 21307 M 0 21307
0 dcce3e5dc1140c3ae954b8ee9e899f77.png 600 600 N N Y 28444 6082 product 21308 M 0 21308
0 Delivard_k7xi-hu.jpg 900 900 N N Y 28623 6114 product 21352 M 0 21352
0 Delivard_k7xi-hu.jpg 900 900 N N Y 28628 6115 product 21352 M 0 21352
0 Delivard_fd78-ph.jpg 900 900 N N Y 29171 6146 product 21458 M 0 21458
0 Delivard_i6h0-kv.jpg 900 900 N N Y 29174 6147 product 21461 M 0 21461
0 Delivard_cda2-35.jpg 900 900 N N Y 29177 6185 product 21464 M 0 21464
0 Delivard_cda2-35.jpg 900 900 N N Y 29182 6186 product 21464 M 0 21464
0 Delivard_cwzf-vh.jpg 900 900 N N Y 29183 6187 product 21467 M 0 21467
0 Delivard_cwzf-vh.jpg 900 900 N N Y 29188 6188 product 21467 M 0 21467
0 Delivard_xyxq-l7.jpg 900 900 N N Y 29774 6297 product 21868 M 0 21868
0 Delivard_xyxq-l7.jpg 900 900 N N Y 29779 6298 product 21868 M 0 21868
0 Delivard_blat-bq.jpg 900 900 N N Y 29780 6299 product 21871 M 0 21871
0 Delivard_blat-bq.jpg 900 900 N N Y 29785 6300 product 21871 M 0 21871
0 Delivard_pnoy-jd.jpg 900 900 N N Y 29792 6303 product 21877 M 0 21877
0 Delivard_pnoy-jd.jpg 900 900 N N Y 29797 6304 product 21877 M 0 21877
0 Delivard_355b-0o.jpg 900 900 N N Y 29798 6305 product 21880 M 0 21880
0 Delivard_355b-0o.jpg 900 900 N N Y 29803 6306 product 21880 M 0 21880
0 30_-_2025-10-22T213331.018.jpg 600 600 N N Y 31051 6749 product 22880 M 0 22880
0 ed3e5ab40bd1fd22d8ae8d8e8216e86f_vmi5-7v.png 350 386 N N Y 31055 6750 product 22882 M 3 22882