#1
⏱️ 146.88 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"rehovot"]
#2
⏱️ 317.98 мс
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",1120,764,768,335,1218,1282,597,1298,349,371,390,20,47,60,81,139,215,1350,455,550,620,1402,134,173,true,1120,764,768,335,1218,1282,597,1298,349,371,390,20,47,60,81,139,215,1350,455,550,620,1402,134,173,"produce"]
#3
⏱️ 171.31 мс
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",1120,764,768,335,1218,1282,597,1298,349,371,390,20,47,60,81,139,215,1350,455,550,620,1402,134,173,true,1120,764,768,335,1218,1282,597,1298,349,371,390,20,47,60,81,139,215,1350,455,550,620,1402,134,173,"produce"]
#4
⏱️ 17.89 мс
select * from "canonical_products" where "canonical_products"."id" in (5, 87, 140, 162, 181, 228, 257, 276, 279, 286, 308)
#5
⏱️ 15.5 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[308,5,181,228,140,87,257,279,276,286,162]
#6
⏱️ 240.46 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4991092,4989961,4987921,4987920,4987918,4987624,4987231,4986722,4986606,4986434,4985340,4984012,4983887,4983785,4983721,4983719,4983613,4952637,4852309,4681547,4678136,4658871,4658870,4658869,4658868,4602029,4601010,4546301,4546295,4546279,4546265,4533498,4983654,195121,207015,110668,207016,195120,110465,2666480,166942,4259731,3569061,112144,155798,195117,111088,109484,109821,207014,195119,1467932,207013,195118,149430,4525248,true,1120,764,768,335,1218,1282,597,1298,349,371,390,20,47,60,81,139,215,1350,455,550,620,1402,134,173]
#7
⏱️ 5.72 мс
select * from "stores" where "stores"."id" in (134, 139, 390, 597)
#8
⏱️ 33.09 мс
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 = 4983654 THEN 4983719 WHEN sp.master_product_id = 4983719 THEN 4983719 WHEN sp.master_product_id = 195121 THEN 4658870 WHEN sp.master_product_id = 4658870 THEN 4658870 WHEN sp.master_product_id = 207015 THEN 4658870 WHEN sp.master_product_id = 110668 THEN 4658870 WHEN sp.master_product_id = 4658871 THEN 4658871 WHEN sp.master_product_id = 207016 THEN 4658871 WHEN sp.master_product_id = 195120 THEN 4658871 WHEN sp.master_product_id = 110465 THEN 4658871 WHEN sp.master_product_id = 4546295 THEN 4546295 WHEN sp.master_product_id = 2666480 THEN 4546295 WHEN sp.master_product_id = 166942 THEN 4681547 WHEN sp.master_product_id = 4259731 THEN 4681547 WHEN sp.master_product_id = 3569061 THEN 4681547 WHEN sp.master_product_id = 112144 THEN 4681547 WHEN sp.master_product_id = 155798 THEN 4681547 WHEN sp.master_product_id = 4681547 THEN 4681547 WHEN sp.master_product_id = 4678136 THEN 4678136 WHEN sp.master_product_id = 195117 THEN 4678136 WHEN sp.master_product_id = 111088 THEN 4678136 WHEN sp.master_product_id = 109484 THEN 4678136 WHEN sp.master_product_id = 109821 THEN 4678136 WHEN sp.master_product_id = 207014 THEN 4658869 WHEN sp.master_product_id = 195119 THEN 4658869 WHEN sp.master_product_id = 4658869 THEN 4658869 WHEN sp.master_product_id = 4602029 THEN 4602029 WHEN sp.master_product_id = 1467932 THEN 4602029 WHEN sp.master_product_id = 4658868 THEN 4658868 WHEN sp.master_product_id = 207013 THEN 4658868 WHEN sp.master_product_id = 195118 THEN 4658868 WHEN sp.master_product_id = 4546301 THEN 4546301 WHEN sp.master_product_id = 149430 THEN 4546301 WHEN sp.master_product_id = 4983721 THEN 4983721 WHEN sp.master_product_id = 4525248 THEN 4983721 ELSE sp.master_product_id END limit 500
Bindings:
[4991092,4989961,4987921,4987920,4987918,4987624,4987231,4986722,4986606,4986434,4985340,4984012,4983887,4983785,4983721,4983719,4983613,4952637,4852309,4681547,4678136,4658871,4658870,4658869,4658868,4602029,4601010,4546301,4546295,4546279,4546265,4533498,4983654,195121,207015,110668,207016,195120,110465,2666480,166942,4259731,3569061,112144,155798,195117,111088,109484,109821,207014,195119,1467932,207013,195118,149430,4525248,0,1120,764,768,335,1218,1282,597,1298,349,371,390,20,47,60,81,139,215,1350,455,550,620,1402,134,173]
#9
⏱️ 58.02 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5936446,5936449,5651967,5651971,1122805,1122809,1210606,1210610,1347341,1347344,2328769,3513908,7798887,7798901,7798917,7798923,2808360,2807713,2806645,2806644,2804314,2807732,3148115,3148190,2804313,3148321,3148423,3148548,3149876,3150970,3151142,3151258,3151767,3152160,3152454,3152456,3152457,3154497,3148152,3002383,3002266,3002267,3002268,3002269,3000761,2998526,3025633,2746089,2746103,2746119,2746125,3079719,3020846,2739956,2739957,2739959,2739958,2739955,3079469,214961,215002,215069,215133,215235,215360,216688,217782,217954,218070,218579,218972,219266,219268,219269,221309,222440]
#10
⏱️ 7.05 мс
select * from "stores" where "stores"."id" in (134, 139, 349, 371, 390, 455, 550, 597, 620, 768)
#11
⏱️ 17.84 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["rehovot"]
#12
⏱️ 12.92 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 16.93 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]