SELECT 
  `F`.`path`, 
  `PI`.`product_id`, 
  `PI`.`alt` 
FROM 
  `cscart_products__images` AS `PI` 
  LEFT JOIN `files` AS `F` ON `PI`.`watermark_small_file_id` = `F`.`id` 
WHERE 
  `PI`.`product_id` IN (28850, 32489, 33426, 12449, 14280)

Query time 0.00063

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "33.00"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "PI",
          "access_type": "range",
          "possible_keys": [
            "product_id"
          ],
          "key": "product_id",
          "used_key_parts": [
            "product_id"
          ],
          "key_length": "3",
          "rows_examined_per_scan": 27,
          "rows_produced_per_join": 27,
          "filtered": "100.00",
          "index_condition": "(`dev2`.`PI`.`product_id` in (28850,32489,33426,12449,14280))",
          "cost_info": {
            "read_cost": "10.71",
            "eval_cost": "2.70",
            "prefix_cost": "13.41",
            "data_read_per_join": "864"
          },
          "used_columns": [
            "product_id",
            "watermark_small_file_id",
            "alt"
          ]
        }
      },
      {
        "table": {
          "table_name": "F",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "id"
          ],
          "key_length": "4",
          "ref": [
            "dev2.PI.watermark_small_file_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 27,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "16.90",
            "eval_cost": "2.70",
            "prefix_cost": "33.01",
            "data_read_per_join": "100K"
          },
          "used_columns": [
            "id",
            "path"
          ]
        }
      }
    ]
  }
}

Result

path product_id alt
https://s3.timeweb.cloud/482029f9-prod/products__images/12449_c50a0b3e8d03_gaz.webp 12449
https://s3.timeweb.cloud/482029f9-prod/products__images/14280_46ecc0bef909_WhatsApp_Image_2024-05-15_at_10.42.12__1__c4oc-4u_wyd9-hj.webp 14280
https://s3.timeweb.cloud/482029f9-prod/products__images/14280_a74e4d69a2e7_WhatsApp_Image_2024-05-15_at_10.42.12_a90k-ug_ntl9-l6.webp 14280
https://s3.timeweb.cloud/482029f9-prod/products__images/14280_1f577f9fd91d_WhatsApp_Image_2024-05-15_at_10.42.12__2__cedn-9y_175k-qt.webp 14280
https://s3.timeweb.cloud/482029f9-prod/products__images/14280_cfaec5831af8_WhatsApp_Image_2024-05-15_at_10.42.12__3__dqy4-6n_s7vy-3a.webp 14280
https://s3.timeweb.cloud/482029f9-prod/products__images/14280_8db29bcb0478_WhatsApp_Image_2024-05-15_at_10.42.13_rlqi-sx_n03x-uj.webp 14280
https://s3.timeweb.cloud/482029f9-prod/products__images/14280_a625120d3bb4_WhatsApp_Image_2024-05-15_at_10.42.13__1__vva1-hj_uf54-rc.webp 14280
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_a1dcb678784a_32808_445cfab290c2_28850_73cab6dfb9b1_28851_7315373b9d68_0_fb381fb5f9e3_IMG_20240124_104104.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_bb3038d0207d_32808_66be0588c3ec_28850_fef41d8c5ca5_28851_750476985ade_0_0f7b907e594e_IMG_20240124_104209.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_0bb38ba95929_32808_bdda38b0cc87_28850_1813247c09c6_28851_6e1cd27f75e0_0_e9a073f35544_IMG_20240124_104202.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_b00bc27cad00_32808_599256b26cc9_28850_fcf9b67a47df_28851_6f7b5ab22632_0_aceb71931c03_IMG_20240124_104151.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_223423b9a634_32808_e1388aa9d021_28850_4e1cb8547356_28851_92581b840ec9_0_531576eef64c_IMG_20240124_104110.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_4e716a236de6_32808_b231e5ea2cc3_28850_09c45ce8c321_28851_80924b48098e_0_801efa0d4078_WhatsApp%2525252520Image%25252525202024-12-17%2525252520at%252525252010.40.20%2525252520%25252525281%2525252529.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_7cd384e33fcb_32808_f0aa89a64d7f_28850_c493758b7591_28851_a9601e522b39_0_964ad0d0c8c9_WhatsApp%2525252520Image%25252525202024-12-17%2525252520at%252525252010.40.19%2525252520%25252525281%2525252529.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_8694487fcc6e_32808_f8c981f19bb2_28850_233640c53469_28851_348bac934a3e_0_c823257167d6_WhatsApp%2525252520Image%25252525202024-12-17%2525252520at%252525252010.40.20.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_62bc2b1754f0_32808_56bf6ddbb6f9_28850_10b3b9f4bc45_28851_9ff0a0b899f6_0_8893a0b9de93_WhatsApp%2525252520Image%25252525202024-12-17%2525252520at%252525252010.40.19.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_cab5be3955c4_32808_2896e559a625_28850_7f0765587bee_28851_28927dd183a6_0_d985202a823f_WhatsApp%2525252520Image%25252525202024-12-17%2525252520at%252525252010.40.17.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_4aa79c96a60d_32808_ece5403ff69a_28850_c6c738fdf0bf_28851_14719744f87f_0_85f507de016b_photo_2023-12-14_16-15-24.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/28850_4b517d4eafee_32808_3bb1e83e4ff6_28850_c419e26123e3_28851_6b9c917f59a1_0_5e42a01a6c68_photo_2023-12-14_16-15-15.webp 28850
https://s3.timeweb.cloud/482029f9-prod/products__images/32489_6a4a8d4729b8_32490_ec7756aa3639_0_cf328582fe1c_unnamed.webp 32489
https://s3.timeweb.cloud/482029f9-prod/products__images/32489_f193d676a039_32490_56f64198728d_0_9f68ca70014c_%2525D0%252598%2525D0%2525B7%2525D0%2525BE%2525D0%2525B1%2525D1%252580%2525D0%2525B0%2525D0%2525B6%2525D0%2525B5%2525D0%2525BD%2525D0%2525B8%2525D0%2525B5%252520WhatsApp%2525202024-04-16%252520%2525D0%2525B2%25252014.06.43_c978353c.webp 32489
https://s3.timeweb.cloud/482029f9-prod/products__images/33426_1fb83fa9312d_33427_48aef0493a68_0_99bf58734816_IMG_20240718_153239jpgwebp 33426
https://s3.timeweb.cloud/482029f9-prod/products__images/33426_d9c5c8874ae9_33427_25cbd7d06110_0_15d327a638f8_IMG_20240718_153215jpgwebp 33426
https://s3.timeweb.cloud/482029f9-prod/products__images/33426_f3d9b7104db1_33427_f1beb0fa8dbe_0_ebf17c92aae1_IMG_20240718_153322jpgwebp 33426
https://s3.timeweb.cloud/482029f9-prod/products__images/33426_f38cbffca7e1_33427_4129f51cf441_0_b64a082dea80_IMG_20240718_153208jpgwebp 33426
https://s3.timeweb.cloud/482029f9-prod/products__images/33426_3ee5304f64de_33427_c7c83428ae36_0_f1269764b2e8_IMG_20240718_153302jpgwebp 33426
https://s3.timeweb.cloud/482029f9-prod/products__images/33426_47228e2f80d4_33427_2fc326e1fc9e_0_2ac17e8d3b2d_IMG_20240718_153254jpgwebp 33426