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` = 26545

Query time 0.00067

Result

product_id file_id file file_alt big_file_id big_file big_file_alt small_file_id small_file small_file_alt
26545 324167 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_3b92cf826c89_processed_lot_94482_20170217100242______________________.jpg.jpg 324171 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_3182a445f573_processed_lot_94482_20170217100242______________________.jpg.webp 324174 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_d524c12a2f72_processed_lot_94482_20170217100242______________________.jpg.webp
26545 324177 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_0dbdcf3cf9f0_processed_lot_94482_20170217100317__________1.jpg.jpg 324182 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_208f67508bbb_processed_lot_94482_20170217100317__________1.jpg.webp 324185 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_68ec1180136c_processed_lot_94482_20170217100317__________1.jpg.webp
26545 324190 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_ce7bfeddf4eb_processed_lot_94482_20170217100340_________.jpg.jpg 324195 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_09e5c19e15c5_processed_lot_94482_20170217100340_________.jpg.webp 324197 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_d90839f24b37_processed_lot_94482_20170217100340_________.jpg.webp
26545 324200 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_a22d744209db_processed_lot_94482_20170217100348____________________________.jpg.jpg 324205 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_910b2ab054f4_processed_lot_94482_20170217100348____________________________.jpg.webp 324208 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_1b13170d48ee_processed_lot_94482_20170217100348____________________________.jpg.webp
26545 324213 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_98438ac84aa0_processed_lot_94482_20170217100358___________.jpg.jpg 324221 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_d8f057d08d5c_processed_lot_94482_20170217100358___________.jpg.webp 324224 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_e73023787edb_processed_lot_94482_20170217100358___________.jpg.webp
26545 324228 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_9155f287547c_processed_lot_94482_20170217100408_______________.jpg.jpg 324235 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_4c1c5aa1cce6_processed_lot_94482_20170217100408_______________.jpg.webp 324239 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_5598da829997_processed_lot_94482_20170217100408_______________.jpg.webp
26545 324242 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_6c8b58e0ca1f_processed_lot_94482_20170217100415_______________1.jpg.jpg 324251 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_f36eb56ffd7c_processed_lot_94482_20170217100415_______________1.jpg.webp 324253 https://s3.timeweb.cloud/482029f9-prod/products__images/26545_3222562e2792_processed_lot_94482_20170217100415_______________1.jpg.webp