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 (5625, 8582, 14261, 5605, 5606)

Query time 0.00038

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "10.67"
    },
    "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": 8,
          "rows_produced_per_join": 8,
          "filtered": "100.00",
          "index_condition": "(`dev2`.`PI`.`product_id` in (5625,8582,14261,5605,5606))",
          "cost_info": {
            "read_cost": "4.06",
            "eval_cost": "0.80",
            "prefix_cost": "4.86",
            "data_read_per_join": "256"
          },
          "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": 8,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "5.01",
            "eval_cost": "0.80",
            "prefix_cost": "10.67",
            "data_read_per_join": "29K"
          },
          "used_columns": [
            "id",
            "path"
          ]
        }
      }
    ]
  }
}

Result

path product_id alt
https://s3.timeweb.cloud/482029f9-prod/products__images/5605_a540028f0a03_SX4186NV361C.webp 5605
https://s3.timeweb.cloud/482029f9-prod/products__images/5606_7ff35ac6b6cb_SX4186NV361.webp 5606
https://s3.timeweb.cloud/482029f9-prod/products__images/5625_ebf875d418a5_9a71c0c67ea460679ff38dce907fed67.webp 5625
https://s3.timeweb.cloud/482029f9-prod/products__images/8582_7973da1b7400_28219_5dd69f5bbb41_8582_5b7f3c7d561c_20230510_100626.webp 8582
https://s3.timeweb.cloud/482029f9-prod/products__images/14261_550e016a5278_einct1tjnuep6dk70fl8vfmx9ke00t9z_9w4k-mi_vigu-nm.webp 14261
https://s3.timeweb.cloud/482029f9-prod/products__images/14261_ce85ee621820_flcbwx098pq8jdwu19qx3522muielr5z__1__hetu-rd_2gi4-t8.webp 14261
https://s3.timeweb.cloud/482029f9-prod/products__images/14261_205fe7a1702b_oi7161i8l2j0bsnhy6oona0je0ucfa9n_o4eh-ui_y6vs-st.webp 14261
https://s3.timeweb.cloud/482029f9-prod/products__images/14261_21a474139370_pi5wbwt47mjj4dj8ermkv9fdeldxibvh_bra1-q1_gydu-ad.webp 14261