#1
⏱️ 139.52 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"karmiel"]
#2
⏱️ 341.66 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_slug" = ? and "subcategory_slug" = ? and (exists (select 1 from "store_prices" where "store_prices"."master_product_id" = "master_products"."id" and "store_prices"."store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) or exists (select 1 from "deals" where "deals"."master_product_id" = "master_products"."id" and "deals"."is_active" = ? and "deals"."store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))) and master_products.id IN (
SELECT DISTINCT ON (COALESCE(canonical_product_id, -id)) id
FROM master_products
WHERE category_slug = ?
ORDER BY COALESCE(canonical_product_id, -id),
CASE WHEN image_url IS NOT NULL AND image_url != '' THEN 0 ELSE 1 END,
id DESC
)
Bindings:
["produce","herbs_mushrooms",743,119,1241,545,1325,398,29,98,186,450,684,true,743,119,1241,545,1325,398,29,98,186,450,684,"produce"]
#3
⏱️ 300.67 мс
select * from "master_products" where "barcode" is not null and "category_slug" = ? and "subcategory_slug" = ? and (exists (select 1 from "store_prices" where "store_prices"."master_product_id" = "master_products"."id" and "store_prices"."store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) or exists (select 1 from "deals" where "deals"."master_product_id" = "master_products"."id" and "deals"."is_active" = ? and "deals"."store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))) and master_products.id IN (
SELECT DISTINCT ON (COALESCE(canonical_product_id, -id)) id
FROM master_products
WHERE category_slug = ?
ORDER BY COALESCE(canonical_product_id, -id),
CASE WHEN image_url IS NOT NULL AND image_url != '' THEN 0 ELSE 1 END,
id DESC
) order by CASE WHEN master_products.image_url IS NOT NULL AND master_products.image_url != '' THEN 0 ELSE 1 END, "master_products"."id" desc limit 32 offset 0
Bindings:
["produce","herbs_mushrooms",743,119,1241,545,1325,398,29,98,186,450,684,true,743,119,1241,545,1325,398,29,98,186,450,684,"produce"]
#4
⏱️ 11.65 мс
select * from "canonical_products" where "canonical_products"."id" in (111, 136, 215, 326)
#5
⏱️ 12.7 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?)
Bindings:
[326,136,215,111]
#6
⏱️ 33.39 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,4063255,4046320,4044670,4044669,4044659,4039527,4039525,4033150,3986687,3977492,3971484,2931321,2710285,2647878,2641760,2606604,2604820,2257475,1962114,1961878,1455907,1454931,1454926,1454900,1071089,703905,703893,149284,134042,109335,112366,100349,100288,true,743,119,1241,545,1325,398,29,98,186,450,684]
#7
⏱️ 12.42 мс
select * from "stores" where "stores"."id" in (29, 98, 119, 398, 743)
#8
⏱️ 30.62 мс
select min(sp.id) as best_sp_id from "store_prices" as "sp" where "sp"."master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "sp"."price" > ? and "sp"."store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) group by sp.store_id, CASE WHEN sp.master_product_id = 703893 THEN 2257475 WHEN sp.master_product_id = 2257475 THEN 2257475 WHEN sp.master_product_id = 3971484 THEN 3971484 WHEN sp.master_product_id = 149284 THEN 3971484 WHEN sp.master_product_id = 134042 THEN 3971484 WHEN sp.master_product_id = 109335 THEN 3971484 WHEN sp.master_product_id = 112366 THEN 2604820 WHEN sp.master_product_id = 2604820 THEN 2604820 WHEN sp.master_product_id = 100349 THEN 3986687 WHEN sp.master_product_id = 100288 THEN 3986687 WHEN sp.master_product_id = 3986687 THEN 3986687 ELSE sp.master_product_id END limit 500
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,4063255,4046320,4044670,4044669,4044659,4039527,4039525,4033150,3986687,3977492,3971484,2931321,2710285,2647878,2641760,2606604,2604820,2257475,1962114,1961878,1455907,1454931,1454926,1454900,1071089,703905,703893,149284,134042,109335,112366,100349,100288,0,743,119,1241,545,1325,398,29,98,186,450,684]
#9
⏱️ 21.56 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5728044,4450954,6454065,1405729,1405717,1412052,2268723,2273999,3357128,3365860,3357248,3357071,3363440,3363442,3368564,3368574,3368576,3370221,7510258,3946754,3880233]
#10
⏱️ 8.07 мс
select * from "stores" where "stores"."id" in (29, 98, 119, 398, 450, 545, 743)
#11
⏱️ 2.03 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["karmiel"]
#12
⏱️ 4.8 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 14.16 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]