#1
⏱️ 154.03 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"kiryat-gat"]
#2
⏱️ 1601.89 мс
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",471,90,243,true,471,90,243]
#3
⏱️ 319.62 мс
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",471,90,243,true,471,90,243]
#4
⏱️ 4.57 мс
select * from "canonical_products" where "canonical_products"."id" in (6)
#5
⏱️ 5.15 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?)
Bindings:
[6]
#6
⏱️ 14.3 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?)
Bindings:
[2975340,2842852,2702452,2640775,2640774,2608194,1474523,1472108,1472107,1469150,1457784,1455751,1455745,1455741,1455705,1451849,1451848,1451847,1451739,364789,274786,256300,198874,195457,175170,175169,171783,168019,164080,162330,161333,161332,1909143,true,471,90,243]
#7
⏱️ 6.6 мс
select * from "stores" where "stores"."id" in (90, 243)
#8
⏱️ 17.64 мс
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 = 1909143 THEN 198874 WHEN sp.master_product_id = 198874 THEN 198874 ELSE sp.master_product_id END limit 500
Bindings:
[2975340,2842852,2702452,2640775,2640774,2608194,1474523,1472108,1472107,1469150,1457784,1455751,1455745,1455741,1455705,1451849,1451848,1451847,1451739,364789,274786,256300,198874,195457,175170,175169,171783,168019,164080,162330,161333,161332,1909143,0,471,90,243]
#9
⏱️ 7.29 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4823299,4820769,4817694,4817706,4817710,4817714,4820778,5384410,35960078,5395334,31552775,11863869,109177740,2481819,33695003,11874251,89831651,72320064,11877035,56507156,11869608,109175978,31552773,35621714,11867876,11867877,11865065,11869521,11869525,11870961,68357342,31552743,30149467,2480064,31546960,11875537,11876770]
#10
⏱️ 8.62 мс
select * from "stores" where "stores"."id" in (90, 243, 471)
#11
⏱️ 10.5 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["kiryat-gat"]
#12
⏱️ 10.95 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 13.1 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]