#1
⏱️ 140.86 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"hadera"]
#2
⏱️ 222.12 мс
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",738,469,155,342,true,738,469,155,342,"produce"]
#3
⏱️ 187.96 мс
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",738,469,155,342,true,738,469,155,342,"produce"]
#4
⏱️ 11.65 мс
select * from "canonical_products" where "canonical_products"."id" in (13, 125, 215, 249)
#5
⏱️ 9.06 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?)
Bindings:
[125,249,215,13]
#6
⏱️ 15.73 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,2984318,2984312,2931321,2710285,2647878,2641760,2633097,2631399,2606604,2604820,1962114,1961878,1455907,1454931,1454926,1454900,364409,205447,204701,193892,192250,192249,159289,135363,135347,134861,99982,162810,156665,162802,134683,112366,162809,true,738,469,155,342]
#7
⏱️ 7.46 мс
select * from "stores" where "stores"."id" in (342, 738)
#8
⏱️ 8.46 мс
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 = 99982 THEN 135363 WHEN sp.master_product_id = 135363 THEN 135363 WHEN sp.master_product_id = 162810 THEN 2984318 WHEN sp.master_product_id = 2984318 THEN 2984318 WHEN sp.master_product_id = 156665 THEN 2984318 WHEN sp.master_product_id = 162802 THEN 2984318 WHEN sp.master_product_id = 134683 THEN 2984318 WHEN sp.master_product_id = 112366 THEN 2604820 WHEN sp.master_product_id = 2604820 THEN 2604820 WHEN sp.master_product_id = 2984312 THEN 2984312 WHEN sp.master_product_id = 162809 THEN 2984312 ELSE sp.master_product_id END limit 500
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,2984318,2984312,2931321,2710285,2647878,2641760,2633097,2631399,2606604,2604820,1962114,1961878,1455907,1454931,1454926,1454900,364409,205447,204701,193892,192250,192249,159289,135363,135347,134861,99982,162810,156665,162802,134683,112366,162809,0,738,469,155,342]
#9
⏱️ 24.94 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5439811,1843072,1844033,1844039,1833102,1833350,1843249,1834630,1836648,1834637,1843050,1843056,4056313,3946749]
#10
⏱️ 8.64 мс
select * from "stores" where "stores"."id" in (342, 469, 738)
#11
⏱️ 6.71 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["hadera"]
#12
⏱️ 8.1 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 9.11 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]