#1
⏱️ 129.82 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"or-akiva"]
#2
⏱️ 623.42 мс
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","fruits",184,355,true,184,355,"produce"]
#3
⏱️ 228.27 мс
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","fruits",184,355,true,184,355,"produce"]
#4
⏱️ 7.46 мс
select * from "canonical_products" where "canonical_products"."id" in (238, 357)
#5
⏱️ 6.44 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?)
Bindings:
[238,357]
#6
⏱️ 20.77 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[8897354,2257916,2151263,2136438,1879667,1879660,1453435,1453427,639411,350790,327734,327732,311485,245269,156089,132430,124636,124495,108505,105712,105707,105200,104329,103390,103031,102459,102205,101709,101485,100922,100921,100819,2317173,96262,true,184,355]
#7
⏱️ 12.9 мс
select * from "stores" where "stores"."id" in (355)
#8
⏱️ 25.27 мс
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 = 2317173 THEN 8897354 WHEN sp.master_product_id = 8897354 THEN 8897354 WHEN sp.master_product_id = 1453427 THEN 1453427 WHEN sp.master_product_id = 96262 THEN 1453427 ELSE sp.master_product_id END limit 500
Bindings:
[8897354,2257916,2151263,2136438,1879667,1879660,1453435,1453427,639411,350790,327734,327732,311485,245269,156089,132430,124636,124495,108505,105712,105707,105200,104329,103390,103031,102459,102205,101709,101485,100922,100921,100819,2317173,96262,0,184,355]
#9
⏱️ 29.04 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4671407,4685165,4674170,774043,774104,774105,774582,769053,5165796,770133,770403,771065,771603,772007,772012,774315,5174251,5165429,774037,5168419,5168433,770084,5168436,5180066]
#10
⏱️ 9.86 мс
select * from "stores" where "stores"."id" in (184, 355)
#11
⏱️ 4.99 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["or-akiva"]
#12
⏱️ 7.46 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 11.76 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]