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 = 'ru' 
WHERE 
  cscart_images_links.object_type = 'product' 
  AND cscart_images_links.type = 'A' 
  AND cscart_images_links.object_id IN (
    446, 311, 1597, 1598, 358, 369, 2764, 
    2765, 2769, 2767, 2766, 2768
  ) 
ORDER BY 
  cscart_images_links.position, 
  cscart_images_links.pair_id

Query time 0.00287

JSON explain

{
  "query_block": {
    "select_id": 1,
    "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"],
          "rows": 56,
          "filtered": 100,
          "index_condition": "cscart_images_links.object_type = 'product' and cscart_images_links.`type` = 'A' and cscart_images_links.object_id in (446,311,1597,1598,358,369,2764,2765,2769,2767,2766,2768)"
        }
      }
    },
    "table": {
      "table_name": "cscart_images",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "4",
      "used_key_parts": ["image_id"],
      "ref": ["noframes_kz_new.cscart_images_links.detailed_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cscart_images_links.detailed_id = cscart_images.image_id)"
    },
    "table": {
      "table_name": "cscart_common_descriptions",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "107",
      "used_key_parts": ["object_id", "lang_code", "object_holder"],
      "ref": ["noframes_kz_new.cscart_images.image_id", "const", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cscart_common_descriptions.object_id = cscart_images.image_id and cscart_common_descriptions.object_holder = 'images' and cscart_common_descriptions.lang_code = 'ru' and trigcond(cscart_images.image_id is not null))"
    }
  }
}

Result

image_id image_path image_x image_y is_high_res rf_original pair_id object_id object_type detailed_id type position alt images_image_id
0 4015281fb2f4a8f402cc272b5377bbfb.jpg 726 484 N 3657 311 product 1865 A 1 1865
0 39fac54eb97b497cda0a7c6612836a5c.jpg 726 484 N 4208 446 product 2416 A 1 2416
0 DSC_1593_1_.jpg 1928 1446 N DSC_1593_1_.jpg 11592 2769 product 9799 A 1 9799
0 e8f9097716451650bc9ee8da55b27615.jpg 1280 535 N 3655 311 product 1863 A 2 1863
0 11f5ec6e7b0d5cf81589dee15c29624f.jpg 736 949 N 4209 446 product 2417 A 2 2417
0 spectrum-fotor-2024082115334_crop.jpg 1340 890 N spectrum-fotor-2024082115334_crop.jpg 10885 369 product 9092 A 2 9092
0 marble_ocean_crop.jpg 1340 890 N marble_ocean_crop.jpg 10956 1597 product 9163 A 2 9163
0 DSC_1621_1_.jpg 1950 1463 N DSC_1621_1_.jpg 11593 2769 product 9800 A 2 9800
0 d93d48484dc474bf9589bcafd30e85f8.jpg 1280 853 N 3656 311 product 1864 A 3 1864
0 terrazzo_1_nag3-ys.jpg 6240 4375 N 5750 446 product 3959 A 3 3959
0 DSC_1631_1_.jpg 1950 1463 N DSC_1631_1_.jpg 11594 2769 product 9801 A 3 9801
0 terrazzo_2.jpg 6720 4480 N 5716 446 product 3925 A 4 3925
0 DSC_1635_1_.jpg 1950 1462 N DSC_1635_1_.jpg 11595 2769 product 9802 A 4 9802
0 terrazzo3_528f-at.jpg 6720 4480 N 5717 446 product 3926 A 5 3926
0 265d5b3f27bddec2af45e2b17db01810.jpg 1340 893 N 265d5b3f27bddec2af45e2b17db01810.jpg 10960 1598 product 9167 A 5 9167
0 DSC_3759.jpg 1950 1463 N DSC_3759.jpg 11596 2769 product 9803 A 5 9803
0 MARBLE_POWDER_3_crop.jpg 1340 890 N MARBLE_POWDER_3_crop.jpg 10961 1598 product 9168 A 6 9168
0 DSC_3760.jpg 1950 1462 N DSC_3760.jpg 11597 2769 product 9804 A 6 9804
0 SPECTRUM3_crop.jpg 1340 890 N SPECTRUM3_crop.jpg 10886 369 product 9093 A 7 9093
0 MARBLE_OCEAN_3_crop.jpg 1340 890 N MARBLE_OCEAN_3_crop.jpg 10957 1597 product 9164 A 7 9164
0 DSC_1373_Fotor.jpg 1950 1462 N DSC_1373_Fotor.jpg 11528 2764 product 9735 A 7 9735
0 DSC_1373_Fotor_3sft-1d.jpg 1950 1462 N DSC_1373_Fotor.jpg 11536 2765 product 9743 A 7 9743
0 DSC_1803_Fotor.jpg 1950 1463 N DSC_1803_Fotor.jpg 11552 2766 product 9759 A 7 9759
0 DSC_3768.jpg 1950 1463 N DSC_3768.jpg 11598 2769 product 9805 A 7 9805
0 2.jpg 1340 811 N 2.jpg 10744 358 product 8951 A 8 8951
0 SPECTRUM2_crop.jpg 1340 890 N SPECTRUM2_crop.jpg 10887 369 product 9094 A 8 9094
0 MARBLE_OCEAN_2_crop.jpg 1340 890 N MARBLE_OCEAN_2_crop.jpg 10958 1597 product 9165 A 8 9165
0 DSC_1378_Fotor.jpg 1950 1463 N DSC_1378_Fotor.jpg 11529 2764 product 9736 A 8 9736
0 DSC_1378_Fotor_u6ue-0v.jpg 1950 1463 N DSC_1378_Fotor.jpg 11537 2765 product 9744 A 8 9744
0 DSC_1812.jpg 1950 1462 N DSC_1812.jpg 11553 2766 product 9760 A 8 9760
0 DSC_3798.jpg 1950 1462 N DSC_3798.jpg 11599 2769 product 9806 A 8 9806
0 boreal_2.jpg 1340 893 N boreal_2.jpg 10745 358 product 8952 A 9 8952
0 DSC_1489_Fotor.jpg 1950 1463 N DSC_1489_Fotor.jpg 11530 2764 product 9737 A 9 9737
0 DSC_1489_Fotor_uqmj-jq.jpg 1950 1463 N DSC_1489_Fotor.jpg 11538 2765 product 9745 A 9 9745
0 DSC_1843_Fotor.jpg 1950 1463 N DSC_1843_Fotor.jpg 11554 2766 product 9761 A 9 9761
0 DSC_3806.jpg 1950 1462 N DSC_3806.jpg 11600 2769 product 9807 A 9 9807
0 boreal_3.jpg 1340 893 N boreal_3.jpg 10746 358 product 8953 A 10 8953
0 DSC_1568_1__Fotor.jpg 1950 1462 N DSC_1568_1__Fotor.jpg 11531 2764 product 9738 A 10 9738
0 DSC_1568_1__Fotor_hvwi-le.jpg 1950 1462 N DSC_1568_1__Fotor.jpg 11539 2765 product 9746 A 10 9746
0 DSC_2912-2.jpg 1950 1462 N DSC_2912-2.jpg 11555 2766 product 9762 A 10 9762
0 DSC_1106-fotor-20240812191730.jpg 1440 1081 N DSC_1106-fotor-20240812191730.jpg 11568 2767 product 9775 A 10 9775
0 DSC_1106-fotor-20240812191730_x96u-i0.jpg 1440 1081 N DSC_1106-fotor-20240812191730.jpg 11579 2768 product 9786 A 10 9786
0 DSC_3809.jpg 1000 750 N DSC_3809.jpg 11601 2769 product 9808 A 10 9808
0 IMG_20240814_155848.jpg 1950 1463 N IMG_20240814_155848.jpg 11532 2764 product 9739 A 11 9739
0 IMG_20240814_155848_4a31-8n.jpg 1950 1463 N IMG_20240814_155848.jpg 11540 2765 product 9747 A 11 9747
0 DSC_2821.jpg 1950 1463 N DSC_2821.jpg 11556 2766 product 9763 A 11 9763
0 DSC_11121.jpg 1937 1452 N DSC_11121.jpg 11569 2767 product 9776 A 11 9776
0 DSC_11121_z1g1-km.jpg 1937 1452 N DSC_11121.jpg 11580 2768 product 9787 A 11 9787
0 DSC_2891-2_1_-fotor-20240821102010.jpg 1950 1463 N DSC_2891-2_1_-fotor-20240821102010.jpg 11533 2764 product 9740 A 12 9740
0 DSC_2891-2_1_-fotor-20240821102010_l9am-sc.jpg 1950 1463 N DSC_2891-2_1_-fotor-20240821102010.jpg 11541 2765 product 9748 A 12 9748
0 DSC_3853-.jpg 1950 1463 N DSC_3853-.jpg 11557 2766 product 9764 A 12 9764
0 IMG_20240813_185848.jpg 1950 1463 N IMG_20240813_185848.jpg 11570 2767 product 9777 A 12 9777
0 IMG_20240813_185848_p2qa-2a.jpg 1950 1463 N IMG_20240813_185848.jpg 11581 2768 product 9788 A 12 9788
0 DSC_2896_1_.jpg 1950 1462 N DSC_2896_1_.jpg 11534 2764 product 9741 A 13 9741
0 DSC_2896_1__u9f0-0n.jpg 1950 1462 N DSC_2896_1_.jpg 11542 2765 product 9749 A 13 9749
0 IMG_20240813_185754.jpg 1950 1463 N IMG_20240813_185754.jpg 11571 2767 product 9778 A 13 9778
0 IMG_20240813_185754_vtxu-ic.jpg 1950 1463 N IMG_20240813_185754.jpg 11582 2768 product 9789 A 13 9789
0 DSC_3886_1__8vlv-y7.jpg 1950 1463 N DSC_3886_1__8vlv-y7.jpg 11535 2764 product 9742 A 14 9742
0 DSC_3886_1__8vlv-y7_r3ys-57.jpg 1950 1463 N DSC_3886_1__8vlv-y7.jpg 11543 2765 product 9750 A 14 9750
0 IMG_20240813_185918.jpg 1578 1183 N IMG_20240813_185918.jpg 11572 2767 product 9779 A 14 9779
0 IMG_20240813_185918_l213-00.jpg 1578 1183 N IMG_20240813_185918.jpg 11583 2768 product 9790 A 14 9790
0 IMG_20240813_185523.jpg 1950 1463 N IMG_20240813_185523.jpg 11573 2767 product 9780 A 15 9780
0 IMG_20240813_185523_hntw-mk.jpg 1950 1463 N IMG_20240813_185523.jpg 11584 2768 product 9791 A 15 9791
0 DSC_2912-2_i202-mg.jpg 1950 1462 N DSC_2912-2_i202-mg.jpg 11574 2767 product 9781 A 16 9781
0 DSC_2912-2_i202-mg_801d-ki.jpg 1950 1462 N DSC_2912-2_i202-mg.jpg 11585 2768 product 9792 A 16 9792
0 IMG_20240813_190718.jpg 1950 1462 N IMG_20240813_190718.jpg 11575 2767 product 9782 A 17 9782
0 IMG_20240813_190718_vxi6-jp.jpg 1950 1462 N IMG_20240813_190718.jpg 11586 2768 product 9793 A 17 9793
0 IMG_20240813_190656.jpg 1950 1462 N IMG_20240813_190656.jpg 11576 2767 product 9783 A 18 9783
0 IMG_20240813_190656_qn6p-eo.jpg 1950 1462 N IMG_20240813_190656.jpg 11587 2768 product 9794 A 18 9794
0 DSC_2821_tqfb-xi.jpg 1950 1463 N DSC_2821_tqfb-xi.jpg 11577 2767 product 9784 A 19 9784
0 DSC_2821_tqfb-xi_e1kn-8i.jpg 1950 1463 N DSC_2821_tqfb-xi.jpg 11588 2768 product 9795 A 19 9795
0 DSC_3853-_gml4-l5.jpg 1950 1463 N DSC_3853-_gml4-l5.jpg 11578 2767 product 9785 A 20 9785
0 DSC_3853-_gml4-l5_a54i-r9.jpg 1950 1463 N DSC_3853-_gml4-l5.jpg 11589 2768 product 9796 A 20 9796
0 BAMBOO_CUPRUM_1.jpg 1257 838 N 5705 311 product 3914 A 31 3914