#1
⏱️ 82.86 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"or-akiva"]
#2
⏱️ 2161.91 мс
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",184,355,true,184,355,"produce"]
#3
⏱️ 379.37 мс
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",184,355,true,184,355,"produce"]
#4
⏱️ 10.22 мс
select * from "canonical_products" where "canonical_products"."id" in (238, 357)
#5
⏱️ 4.87 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?)
Bindings:
[238,357]
#6
⏱️ 10.95 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[8897354,2257916,2151263,2136438,1879667,1879660,1453435,1453427,1452559,639411,350790,327734,327732,311485,245269,156536,156089,155846,132430,131805,130390,127404,124636,124495,112340,108505,108229,107138,107031,106702,106481,105712,2317173,96262,true,184,355]
#7
⏱️ 4.38 мс
select * from "stores" where "stores"."id" in (184, 355)
#8
⏱️ 12.12 мс
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,1452559,639411,350790,327734,327732,311485,245269,156536,156089,155846,132430,131805,130390,127404,124636,124495,112340,108505,108229,107138,107031,106702,106481,105712,2317173,96262,0,184,355]
#9
⏱️ 19.5 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4685165,61030042,4682634,4674170,772012,772661,772845,5174321,773209,774101,774315,772496,5174251,5171020,5165429,770165,770454,774037,5168419,5168433,5165689,770084,5168436,5180066]
#10
⏱️ 9.63 мс
select * from "stores" where "stores"."id" in (184, 355)
#11
⏱️ 3.29 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["or-akiva"]
#12
⏱️ 3.96 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 15.4 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]