#1
⏱️ 133.69 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"nazareth"]
#2
⏱️ 243.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","herbs_mushrooms",744,26,183,475,669,107,true,744,26,183,475,669,107,"produce"]
#3
⏱️ 160.6 мс
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",744,26,183,475,669,107,true,744,26,183,475,669,107,"produce"]
#4
⏱️ 6.2 мс
select * from "canonical_products" where "canonical_products"."id" in (215)
#5
⏱️ 5.15 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?)
Bindings:
[215]
#6
⏱️ 9.38 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?)
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,2931321,2647878,2641760,2606604,2604820,1962114,1961878,1455907,1454931,1454926,1454900,364409,205447,193892,192249,159289,132354,132349,130124,130122,130115,129977,129973,129632,128513,128297,112366,true,744,26,183,475,669,107]
#7
⏱️ 6.24 мс
select * from "stores" where "stores"."id" in (107, 744)
#8
⏱️ 8.96 мс
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 = 112366 THEN 2604820 WHEN sp.master_product_id = 2604820 THEN 2604820 ELSE sp.master_product_id END limit 500
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,2931321,2647878,2641760,2606604,2604820,1962114,1961878,1455907,1454931,1454926,1454900,364409,205447,193892,192249,159289,132354,132349,130124,130122,130115,129977,129973,129632,128513,128297,112366,0,744,26,183,475,669,107]
#9
⏱️ 7.08 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2498887,2498611,2498818,2498819,2499458,2499460,2499462,2499454,2499455,2498604,2498822,2498599,4056319,3946755]
#10
⏱️ 4.77 мс
select * from "stores" where "stores"."id" in (475, 744)
#11
⏱️ 3.72 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["nazareth"]
#12
⏱️ 4.38 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 1.91 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]