#1
⏱️ 196.57 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"holon"]
#2
⏱️ 565.41 мс
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",1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411,true,1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411,"produce"]
#3
⏱️ 155.01 мс
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",1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411,true,1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411,"produce"]
#4
⏱️ 7.88 мс
select * from "canonical_products" where "canonical_products"."id" in (136, 163, 193, 336)
#5
⏱️ 8.04 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?)
Bindings:
[193,163,136,336]
#6
⏱️ 67.56 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,7529293,4213727,4063255,4039527,4039525,4020207,3977492,3971484,3844601,3734287,3676089,2988675,2932814,2931321,2752778,2701771,2679322,2671026,2670964,2666758,2666027,2664001,2647878,2641760,2633097,2607777,149284,134042,109335,158027,195156,112362,2657528,true,1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411]
#7
⏱️ 2.54 мс
select * from "stores" where "stores"."id" in (528)
#8
⏱️ 15.34 мс
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 = 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 = 158027 THEN 4213727 WHEN sp.master_product_id = 4213727 THEN 4213727 WHEN sp.master_product_id = 195156 THEN 4213727 WHEN sp.master_product_id = 7529293 THEN 7529293 WHEN sp.master_product_id = 112362 THEN 7529293 WHEN sp.master_product_id = 2679322 THEN 2679322 WHEN sp.master_product_id = 2657528 THEN 2679322 ELSE sp.master_product_id END limit 500
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,7529293,4213727,4063255,4039527,4039525,4020207,3977492,3971484,3844601,3734287,3676089,2988675,2932814,2931321,2752778,2701771,2679322,2671026,2670964,2666758,2666027,2664001,2647878,2641760,2633097,2607777,149284,134042,109335,158027,195156,112362,2657528,0,1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411]
#9
⏱️ 19.77 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2425877,2420417,2421630,2420087,2415391,2422672,2419669,2419783,2422539,2419115,2578039,2576327,2578031,62661,64648,3535683,3539250,3537570,3537558,3537560,3538225,3537403,3667172,1764379,1754569,1754582,1754629,1754751,1754043,1752829,1763494,1758807,1758706,1762819,1763301]
#10
⏱️ 2.63 мс
select * from "stores" where "stores"."id" in (463, 497, 528, 552, 573, 752)
#11
⏱️ 16.31 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["holon"]
#12
⏱️ 9.82 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 14.07 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]