#1
⏱️ 99.12 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"safed"]
#2
⏱️ 455.01 мс
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","baking_spices",101,275,true,101,275]
#3
⏱️ 182.98 мс
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","baking_spices",101,275,true,101,275]
#4
⏱️ 5.52 мс
select * from "canonical_products" where "canonical_products"."id" in (64, 225)
#5
⏱️ 3.05 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?)
Bindings:
[64,225]
#6
⏱️ 24.38 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[1908616,1908615,1465150,1457784,1455751,1455745,1455741,1455708,1455705,1455698,1455697,1451739,1433604,256300,248808,206567,161333,161332,160615,158192,155100,135564,133204,131476,130832,130360,127513,114548,114016,112045,110156,110155,130435,100585,97793,true,101,275]
#7
⏱️ 4.64 мс
select * from "stores" where "stores"."id" in (101, 275)
#8
⏱️ 19.7 мс
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 = 1465150 THEN 1465150 WHEN sp.master_product_id = 130435 THEN 1465150 WHEN sp.master_product_id = 1455697 THEN 1455697 WHEN sp.master_product_id = 100585 THEN 1455697 WHEN sp.master_product_id = 97793 THEN 1455697 ELSE sp.master_product_id END limit 500
Bindings:
[1908616,1908615,1465150,1457784,1455751,1455745,1455741,1455708,1455705,1455698,1455697,1451739,1433604,256300,248808,206567,161333,161332,160615,158192,155100,135564,133204,131476,130832,130360,127513,114548,114016,112045,110156,110155,130435,100585,97793,0,101,275]
#9
⏱️ 12.04 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6218540,80149401,6216163,81722975,6218171,70750952,6223927,5376542,5376543,5392659,5390034,5388019,5388065,5376541,5390404,5376569,5376222,5388260,5388261,5388301,5385943,5388233,5373818,5384121,5384123,5384130,5384134,5384153,5384157,5384161,5388241,5383996,5381447,5381448]
#10
⏱️ 1.36 мс
select * from "stores" where "stores"."id" in (101, 275)
#11
⏱️ 12.28 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["safed"]
#12
⏱️ 7.15 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 8.65 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]