#1
⏱️ 168.27 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"or-akiva"]
#2
⏱️ 428.97 мс
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",355,184,true,355,184,"produce"]
#3
⏱️ 322.35 мс
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",355,184,true,355,184,"produce"]
#4
⏱️ 18.65 мс
select * from "canonical_products" where "canonical_products"."id" in (357)
#5
⏱️ 9.83 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?)
Bindings:
[357]
#6
⏱️ 23.39 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[1879660,1472828,1454960,1453427,1439039,1439037,1435142,1428126,1428121,814424,785014,785013,784272,639411,350790,327734,327732,311485,253681,245269,242616,169653,156089,132430,124636,124495,108505,105712,105707,105200,104329,103390,96262,true,355,184]
#7
⏱️ 11.39 мс
select * from "stores" where "stores"."id" in (184, 355)
#8
⏱️ 14.89 мс
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 = 96262 THEN 1453427 WHEN sp.master_product_id = 1453427 THEN 1453427 ELSE sp.master_product_id END limit 500
Bindings:
[1879660,1472828,1454960,1453427,1439039,1439037,1435142,1428126,1428121,814424,785014,785013,784272,639411,350790,327734,327732,311485,253681,245269,242616,169653,156089,132430,124636,124495,108505,105712,105707,105200,104329,103390,96262,0,355,184]
#9
⏱️ 15.77 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4685165,4674170,4687212,4677097,4679883,4679892,4668104,4687153,4687154,4677112,770403,771065,771603,772007,772012,774315,5174251,5165429,774037,5168419,5168433,5171089,5173859,5173860,5173858,770084,5168650,5168436]
#10
⏱️ 12.3 мс
select * from "stores" where "stores"."id" in (184, 355)
#11
⏱️ 14.24 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["or-akiva"]
#12
⏱️ 11.95 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 13 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]