SELECT 
  PI.product_id, 
  F1.id AS file_id, 
  F1.path AS file, 
  (
    SELECT 
      PI1.alt 
    FROM 
      `cscart_products__images` PI1 
    WHERE 
      PI1.original_file_id = F1.id
  ) AS file_alt, 
  F2.id AS big_file_id, 
  F2.path AS big_file, 
  (
    SELECT 
      PI2.alt 
    FROM 
      `cscart_products__images` PI2 
    WHERE 
      PI2.watermark_big_file_id = F2.id
  ) AS big_file_alt, 
  F3.id AS small_file_id, 
  F3.path AS small_file, 
  (
    SELECT 
      PI3.alt 
    FROM 
      `cscart_products__images` PI3 
    WHERE 
      PI3.watermark_small_file_id = F3.id
  ) AS small_file_alt 
FROM 
  `cscart_products__images` AS `PI` 
  LEFT JOIN `files` AS `F1` ON `F1`.`id` = `PI`.`original_file_id` 
  LEFT JOIN `files` AS `F2` ON `F2`.`id` = `PI`.`watermark_big_file_id` 
  LEFT JOIN `files` AS `F3` ON `F3`.`id` = `PI`.`watermark_small_file_id` 
WHERE 
  `PI`.`product_id` = 33426

Query time 0.00059

Result

product_id file_id file file_alt big_file_id big_file big_file_alt small_file_id small_file small_file_alt
33426 414698 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_3fa95a5377b2_33427_48aef0493a68_0_99bf58734816_IMG_20240718_153239jpg 414699 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_fd206ecd2f6b_33427_48aef0493a68_0_99bf58734816_IMG_20240718_153239jpgwebp 414700 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_1fb83fa9312d_33427_48aef0493a68_0_99bf58734816_IMG_20240718_153239jpgwebp
33426 414701 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_f4a8c8488fa0_33427_25cbd7d06110_0_15d327a638f8_IMG_20240718_153215jpg 414702 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_5d9d5885c57d_33427_25cbd7d06110_0_15d327a638f8_IMG_20240718_153215jpgwebp 414703 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_d9c5c8874ae9_33427_25cbd7d06110_0_15d327a638f8_IMG_20240718_153215jpgwebp
33426 414704 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_ba3140fa795c_33427_f1beb0fa8dbe_0_ebf17c92aae1_IMG_20240718_153322jpg 414705 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_13955663ff40_33427_f1beb0fa8dbe_0_ebf17c92aae1_IMG_20240718_153322jpgwebp 414706 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_f3d9b7104db1_33427_f1beb0fa8dbe_0_ebf17c92aae1_IMG_20240718_153322jpgwebp
33426 414707 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_ca92bcfbffcc_33427_4129f51cf441_0_b64a082dea80_IMG_20240718_153208jpg 414708 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_bc951e18349a_33427_4129f51cf441_0_b64a082dea80_IMG_20240718_153208jpgwebp 414709 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_f38cbffca7e1_33427_4129f51cf441_0_b64a082dea80_IMG_20240718_153208jpgwebp
33426 414710 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_71800e45b637_33427_c7c83428ae36_0_f1269764b2e8_IMG_20240718_153302jpg 414711 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_808770979e88_33427_c7c83428ae36_0_f1269764b2e8_IMG_20240718_153302jpgwebp 414712 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_3ee5304f64de_33427_c7c83428ae36_0_f1269764b2e8_IMG_20240718_153302jpgwebp
33426 414713 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_a9cc4edd0389_33427_2fc326e1fc9e_0_2ac17e8d3b2d_IMG_20240718_153254jpg 414714 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_659967349d06_33427_2fc326e1fc9e_0_2ac17e8d3b2d_IMG_20240718_153254jpgwebp 414715 https://s3.timeweb.cloud/482029f9-prod/products__images/33426_47228e2f80d4_33427_2fc326e1fc9e_0_2ac17e8d3b2d_IMG_20240718_153254jpgwebp