#1
⏱️ 117.12 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"or-akiva"]
#2
⏱️ 198.37 мс
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",355,184,true,355,184,"produce"]
#3
⏱️ 115.14 мс
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",355,184,true,355,184,"produce"]
#4
⏱️ 4.52 мс
select * from "canonical_products" where "canonical_products"."id" in (59, 98, 203, 230, 327, 340, 351, 375, 376)
#5
⏱️ 5.54 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[98,327,230,376,351,340,375,203,59]
#6
⏱️ 15.66 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[107138,100730,100538,100390,100384,100366,100357,100350,100348,100347,100286,100285,100159,100154,100127,100111,100110,100066,100054,100053,99984,99974,99904,99873,99872,99823,99819,99279,99113,99047,98525,98395,98526,97293,95627,100284,100002,100021,100287,97589,100283,true,355,184]
#7
⏱️ 7.94 мс
select * from "stores" where "stores"."id" in (355)
#8
⏱️ 14.19 мс
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 = 98526 THEN 99279 WHEN sp.master_product_id = 99279 THEN 99279 WHEN sp.master_product_id = 100366 THEN 100366 WHEN sp.master_product_id = 97293 THEN 100366 WHEN sp.master_product_id = 95627 THEN 99974 WHEN sp.master_product_id = 99974 THEN 99974 WHEN sp.master_product_id = 100284 THEN 100350 WHEN sp.master_product_id = 100350 THEN 100350 WHEN sp.master_product_id = 100357 THEN 100357 WHEN sp.master_product_id = 100002 THEN 100357 WHEN sp.master_product_id = 100021 THEN 100154 WHEN sp.master_product_id = 100154 THEN 100154 WHEN sp.master_product_id = 100287 THEN 100347 WHEN sp.master_product_id = 100347 THEN 100347 WHEN sp.master_product_id = 99984 THEN 99984 WHEN sp.master_product_id = 97589 THEN 99984 WHEN sp.master_product_id = 100348 THEN 100348 WHEN sp.master_product_id = 100283 THEN 100348 ELSE sp.master_product_id END limit 500
Bindings:
[107138,100730,100538,100390,100384,100366,100357,100350,100348,100347,100286,100285,100159,100154,100127,100111,100110,100066,100054,100053,99984,99974,99904,99873,99872,99823,99819,99279,99113,99047,98525,98395,98526,97293,95627,100284,100002,100021,100287,97589,100283,0,355,184]
#9
⏱️ 6.16 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[771735,771846,772387,5173967,771847,773127,773131,773190,773191,773208,769509,773268,773320,773321,773332,773369,773370,773384,773410,773413,773529,773530,773531,773527,773528,773283,770963,773621,773626,773762,773964,773209]
#10
⏱️ 5.55 мс
select * from "stores" where "stores"."id" in (355)
#11
⏱️ 5.68 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["or-akiva"]
#12
⏱️ 7.23 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 5.08 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]