#1
⏱️ 169.89 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"ramat-hasharon"]
#2
⏱️ 832.89 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_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",646,142,true,646,142,"produce"]
#3
⏱️ 884.46 мс
select * from "master_products" where "barcode" is not null and "category_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",646,142,true,646,142,"produce"]
#4
⏱️ 18.44 мс
select * from "canonical_products" where "canonical_products"."id" in (79, 80, 82, 266, 291)
#5
⏱️ 12.8 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?)
Bindings:
[80,79,266,291,82]
#6
⏱️ 28.4 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[2257916,2190661,2190128,2151263,2136438,2045870,1879673,1879254,1453435,959071,948398,945539,856493,834838,713221,639411,598059,499851,497990,496502,496460,449841,438372,436382,397136,362451,362427,362409,362326,327734,327732,311485,97564,109889,109243,134681,150736,190899,364246,94988,true,646,142]
#7
⏱️ 21.33 мс
select * from "stores" where "stores"."id" in (142)
#8
⏱️ 30.76 мс
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 = 2190128 THEN 2190128 WHEN sp.master_product_id = 97564 THEN 2190128 WHEN sp.master_product_id = 2190661 THEN 2190661 WHEN sp.master_product_id = 109889 THEN 2190661 WHEN sp.master_product_id = 109243 THEN 496502 WHEN sp.master_product_id = 496502 THEN 496502 WHEN sp.master_product_id = 134681 THEN 496502 WHEN sp.master_product_id = 150736 THEN 496502 WHEN sp.master_product_id = 190899 THEN 496502 WHEN sp.master_product_id = 364246 THEN 959071 WHEN sp.master_product_id = 959071 THEN 959071 WHEN sp.master_product_id = 834838 THEN 834838 WHEN sp.master_product_id = 94988 THEN 834838 ELSE sp.master_product_id END limit 500
Bindings:
[2257916,2190661,2190128,2151263,2136438,2045870,1879673,1879254,1453435,959071,948398,945539,856493,834838,713221,639411,598059,499851,497990,496502,496460,449841,438372,436382,397136,362451,362427,362409,362326,327734,327732,311485,97564,109889,109243,134681,150736,190899,364246,94988,0,646,142]
#9
⏱️ 33.52 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5511951,10412938,5512062,5512082,65453415,61886536,5528220,5517282,5523913,5533703,5511979,5512036,5511954,5512048,5512037,5524394,27556002,5506973,5511993,5519246,80149629]
#10
⏱️ 18.08 мс
select * from "stores" where "stores"."id" in (142)
#11
⏱️ 21.82 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["ramat-hasharon"]
#12
⏱️ 20.93 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 16.28 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]