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 (28868, 28870, 28872, 28887, 11373)

Query time 0.00048

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "7.13"
    },
    "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": 5,
          "rows_produced_per_join": 5,
          "filtered": "100.00",
          "index_condition": "(`dev2`.`PI`.`product_id` in (28868,28870,28872,28887,11373))",
          "cost_info": {
            "read_cost": "3.01",
            "eval_cost": "0.50",
            "prefix_cost": "3.51",
            "data_read_per_join": "160"
          },
          "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": 5,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "3.12",
            "eval_cost": "0.50",
            "prefix_cost": "7.13",
            "data_read_per_join": "18K"
          },
          "used_columns": [
            "id",
            "path"
          ]
        }
      }
    ]
  }
}

Result

path product_id alt
https://s3.timeweb.cloud/482029f9-prod/products__images/11373_36150f546159_ZT10_9dsf-gx_2ivw-6c.webp 11373
https://s3.timeweb.cloud/482029f9-prod/products__images/28868_ac4f18a13456_28869_cd9b21743b52_0_f44e08182090_ustanovka-gnb-xcmg-xz120e-1_1.webp 28868
https://s3.timeweb.cloud/482029f9-prod/products__images/28870_0e3bfa06c5bd_28871_5c6416f13994_0_2f445fde635b_25be83217acdb20e06b6d8eb1dddc24b.webp 28870
https://s3.timeweb.cloud/482029f9-prod/products__images/28872_102a69354b71_28873_0927bf2302d9_0_6eab632fb703_gen1200.webp 28872
https://s3.timeweb.cloud/482029f9-prod/products__images/28887_0fd1621ee5d5_28888_9a947bf8dd22_0_8f124cf3ebb1_DeWatermark.ai_1734670654831.webp 28887