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 ('30771')

Query time 0.00042

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "5.38"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "PI",
          "access_type": "ref",
          "possible_keys": [
            "product_id"
          ],
          "key": "product_id",
          "used_key_parts": [
            "product_id"
          ],
          "key_length": "3",
          "ref": [
            "const"
          ],
          "rows_examined_per_scan": 5,
          "rows_produced_per_join": 5,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "1.25",
            "eval_cost": "0.50",
            "prefix_cost": "1.75",
            "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.13",
            "eval_cost": "0.50",
            "prefix_cost": "5.38",
            "data_read_per_join": "18K"
          },
          "used_columns": [
            "id",
            "path"
          ]
        }
      }
    ]
  }
}

Result

path product_id alt
https://s3.timeweb.cloud/482029f9-prod/products__images/30771_7a60932bfb2b_30931_8a70660eeabd_30771_f2837d2f022e_30828_838039eb6873_30771_036266890dce_30772_f2efda97d45d_0_12a472be5623_WhatsApp%25252525252520Image%252525252525202024-04-15%25252525252520at%2525252525252013.54.58%25252525252520%252525252525281%25252525252529.webp 30771
https://s3.timeweb.cloud/482029f9-prod/products__images/30771_97720d40c932_30931_414baa2e8c96_30771_df928b23bc44_30828_14cdfbd0491a_30771_37cae5ef8dd7_30772_0677488e99dd_0_fcd27a83b1c7_WhatsApp%25252525252520Image%252525252525202024-04-15%25252525252520at%2525252525252013.54.58.webp 30771
https://s3.timeweb.cloud/482029f9-prod/products__images/30771_cdfb67b4e412_30931_60df1ff17a27_30771_7ffbf7af3bf3_30828_66e225c54eab_30771_c511f7f620f6_30772_3db7c419fdce_0_4358643ca39c_WhatsApp%25252525252520Image%252525252525202024-04-15%25252525252520at%2525252525252013.54.57.webp 30771
https://s3.timeweb.cloud/482029f9-prod/products__images/30771_d221c5aa3e7e_30931_ece2073823b5_30771_2717486217e8_30828_718e0387d457_30771_8d556cdd9ee8_30772_96cc746a0679_0_76d6fca49ec6_WhatsApp%25252525252520Image%252525252525202024-04-15%25252525252520at%2525252525252013.54.57%25252525252520%252525252525281%25252525252529.webp 30771
https://s3.timeweb.cloud/482029f9-prod/products__images/30771_33e9cf8a6fbb_30931_6b1b827c7818_30771_ab0d820720ad_30828_6f0a09d6d5cd_30771_e8ddcf625fc8_30772_aa52db6f1558_0_462b09e8a9f1_photo_5348171368530828228_y.webp 30771