#1
⏱️ 156.35 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"safed"]
#2
⏱️ 867.11 мс
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 (?, ?)))
Bindings:
["grocery","canned_preserves",101,275,true,101,275]
#3
⏱️ 188.08 мс
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 (?, ?))) 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:
["grocery","canned_preserves",101,275,true,101,275]
#4
⏱️ 10.61 мс
select * from "canonical_products" where "canonical_products"."id" in (242, 337)
#5
⏱️ 4.42 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?)
Bindings:
[242,337]
#6
⏱️ 30.94 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[4536333,1954840,1918287,1915185,1912286,1912018,1911972,1910474,1909369,1909366,1908153,1908144,1463675,1462249,1458610,1455752,1453961,1453960,1452294,1451883,1451765,1434518,349469,193602,135279,135278,133426,132282,132281,115099,113169,112881,4227275,98614,true,101,275]
#7
⏱️ 4.46 мс
select * from "stores" where "stores"."id" in (101, 275)
#8
⏱️ 17.95 мс
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 = 1915185 THEN 1915185 WHEN sp.master_product_id = 4227275 THEN 1915185 WHEN sp.master_product_id = 349469 THEN 349469 WHEN sp.master_product_id = 98614 THEN 349469 ELSE sp.master_product_id END limit 500
Bindings:
[4536333,1954840,1918287,1915185,1912286,1912018,1911972,1910474,1909369,1909366,1908153,1908144,1463675,1462249,1458610,1455752,1453961,1453960,1452294,1451883,1451765,1434518,349469,193602,135279,135278,133426,132282,132281,115099,113169,112881,4227275,98614,0,101,275]
#9
⏱️ 11.92 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6216323,6218506,67325032,67325031,5386199,5388026,5389967,5385882,5385883,5386119,5386121,5384007,5402709,5373832,5373912,5374105,5378910,5378914,5384162,5390365,5374040,5378801,5378911,5378920,5385962,5385965,5390334,8318271,5400078,5400505,5384210,5398361]
#10
⏱️ 10.52 мс
select * from "stores" where "stores"."id" in (101, 275)
#11
⏱️ 11.76 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["safed"]
#12
⏱️ 10.15 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 13.02 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]