#1
⏱️ 117.64 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"ashkelon"]
#2
⏱️ 1323.54 мс
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",737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405]
#3
⏱️ 904.14 мс
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",737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405]
#4
⏱️ 12.71 мс
select * from "canonical_products" where "canonical_products"."id" in (8)
#5
⏱️ 12.97 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?)
Bindings:
[8]
#6
⏱️ 29.8 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775716,7455589,7455588,7065236,6745776,6730411,4987518,4536333,4402031,4193606,4131723,4075884,4061313,4018216,4017115,4006000,4002085,3997644,3990586,3985219,3980651,3980340,3973282,3972362,3972212,3971502,3971196,3739767,3646497,3041110,2717082,2717075,1462716,3170808,123050,160427,2812826,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405]
#7
⏱️ 11.29 мс
select * from "stores" where "stores"."id" in (37, 122, 131, 352, 405, 737)
#8
⏱️ 31.85 мс
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 = 1462716 THEN 3041110 WHEN sp.master_product_id = 3170808 THEN 3041110 WHEN sp.master_product_id = 123050 THEN 3041110 WHEN sp.master_product_id = 3041110 THEN 3041110 WHEN sp.master_product_id = 160427 THEN 3041110 WHEN sp.master_product_id = 2812826 THEN 3041110 ELSE sp.master_product_id END limit 500
Bindings:
[8775716,7455589,7455588,7065236,6745776,6730411,4987518,4536333,4402031,4193606,4131723,4075884,4061313,4018216,4017115,4006000,4002085,3997644,3990586,3985219,3980651,3980340,3973282,3972362,3972212,3971502,3971196,3739767,3646497,3041110,2717082,2717075,1462716,3170808,123050,160427,2812826,0,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405]
#9
⏱️ 44.06 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[67324962,68099137,67917247,78882943,69315033,11743381,31503231,2463212,37639938,11763199,11767716,11766267,12113481,33832522,30280301,31718252,31718009,31718865,31718866,3348658,24361209,24361516,24363220,24363369,24365289,3817829,24380711,3355640,68068939,77842409,3354436,13241390,3341071,3342169,24368306,7475610,77838858,25019010,24369526,9603703,9593123]
#10
⏱️ 11.1 мс
select * from "stores" where "stores"."id" in (37, 122, 131, 352, 405, 467, 489, 544, 737)
#11
⏱️ 8.25 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["ashkelon"]
#12
⏱️ 11.61 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 12.9 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]