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 (8922, 9068, 28231, 28233, 28241)

Query time 0.00050

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "42.32"
    },
    "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": 35,
          "rows_produced_per_join": 35,
          "filtered": "100.00",
          "index_condition": "(`dev2`.`PI`.`product_id` in (8922,9068,28231,28233,28241))",
          "cost_info": {
            "read_cost": "13.51",
            "eval_cost": "3.50",
            "prefix_cost": "17.01",
            "data_read_per_join": "1K"
          },
          "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": 35,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "21.81",
            "eval_cost": "3.50",
            "prefix_cost": "42.32",
            "data_read_per_join": "130K"
          },
          "used_columns": [
            "id",
            "path"
          ]
        }
      }
    ]
  }
}

Result

path product_id alt
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_977dbfdb40c6_20230923_104044.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_be7fa475fe4c_20230923_104105.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_82a2af384e85_20230923_104105_ny5q-wq.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_92f1fbcdba23_20230923_104033.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_5bffaf21f38f_20230923_104033_12z1-5b.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_a89340d5bb01_20230923_104114.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_c6f984a0b833_20230923_104114_8ccb-8c.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_a88592b2c278_20230923_104132.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_dba221d6d035_20230923_104132_27td-r4.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_5a0d1641a727_20230923_104142.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_81be3b8edc1e_20230923_104142_5chg-8k.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_41adbf3ed895_20230923_104154.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_2bde8ca3f6dd_20230923_104154_jqnw-hr.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_3614403998b4_20230923_104202.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_12d828821dac_20230923_104202_j05m-gt.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_df6af5956cad_20230923_104229.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_61eddd5dd40f_20230923_104229_br21-bt.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_24e045642165_20230923_104315.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_ee3181babd56_20230923_104315_umv3-g6.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_fd013999b46b_20230923_104440.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_89def6a15c37_20230923_104440_z5cs-rc.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_74ade4e2002d_20230923_104358.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_64bbf11bb755_20230923_104358_hfh3-zm.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_b5c6a9541359_20230923_104323.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_81fc8d206df9_20230923_104323_0818-vw.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_eabcbc0364ac_20230923_104332.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_ac1eb8b91e7e_20230923_104332_me5f-2z.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_4b5f11950aa3_20230923_104510.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_fa354ab417a7_20230923_104510_7xg1-u5.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_9cb63e990090_20230923_104458.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/8922_b63a02c15333_20230923_104458_d3f8-9u.webp 8922
https://s3.timeweb.cloud/482029f9-prod/products__images/9068_5dab05197e56_%D0%9A%D0%9F__%D0%93%D0%B0%D0%B7%D0%B5%D0%BB%D1%8C_%D0%9D%D0%B5%D0%BA%D1%81%D1%82_A65R52_19_3_1.webp 9068
https://s3.timeweb.cloud/482029f9-prod/products__images/28231_c9e0b1af7390_28232_f2413be21b30_0_91f336d0388d_%2525D0%2525A0%2525D0%2525B8%2525D1%252581%2525D1%252583%2525D0%2525BD%2525D0%2525BE%2525D0%2525BA5.webp 28231
https://s3.timeweb.cloud/482029f9-prod/products__images/28233_7dd35fcf6566_28234_cea4d605249f_0_66df2aebd681_%2525D0%2525A0%2525D0%2525B8%2525D1%252581%2525D1%252583%2525D0%2525BD%2525D0%2525BE%2525D0%2525BA6.webp 28233
https://s3.timeweb.cloud/482029f9-prod/products__images/28241_31385735f03e_28242_5171978ec16b_0_16d5cddc7622_%2525D0%2525A0%2525D0%2525B8%2525D1%252581%2525D1%252583%2525D0%2525BD%2525D0%2525BE%2525D0%2525BA10.webp 28241