#1
⏱️ 140.38 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"bat-yam"]
#2
⏱️ 345.4 мс
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",751,1121,1250,1260,618,459,676,675,677,124,232,318,409,true,751,1121,1250,1260,618,459,676,675,677,124,232,318,409,"produce"]
#3
⏱️ 297.39 мс
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",751,1121,1250,1260,618,459,676,675,677,124,232,318,409,true,751,1121,1250,1260,618,459,676,675,677,124,232,318,409,"produce"]
#4
⏱️ 4.98 мс
select * from "canonical_products" where "canonical_products"."id" in (79, 111, 162, 193, 215, 235)
#5
⏱️ 4.39 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?)
Bindings:
[193,162,215,235,111,79]
#6
⏱️ 11.01 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[7529293,7493489,4991092,4987921,4987920,4987918,4987624,4987231,4985340,4983785,4983613,4546295,4533498,4524189,3771787,2931321,2812735,2752778,2710285,2671026,2670964,2666758,2666106,2664001,2656726,2633097,2604820,2604816,2257475,2190128,1456754,1454930,97564,703893,2666480,112362,112366,112361,true,751,1121,1250,1260,618,459,676,675,677,124,232,318,409]
#7
⏱️ 2 мс
select * from "stores" where "stores"."id" in (124, 318, 409)
#8
⏱️ 8.82 мс
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 = 2190128 THEN 2190128 WHEN sp.master_product_id = 97564 THEN 2190128 WHEN sp.master_product_id = 703893 THEN 2257475 WHEN sp.master_product_id = 2257475 THEN 2257475 WHEN sp.master_product_id = 4546295 THEN 4546295 WHEN sp.master_product_id = 2666480 THEN 4546295 WHEN sp.master_product_id = 7529293 THEN 7529293 WHEN sp.master_product_id = 112362 THEN 7529293 WHEN sp.master_product_id = 2604820 THEN 2604820 WHEN sp.master_product_id = 112366 THEN 2604820 WHEN sp.master_product_id = 112361 THEN 2604816 WHEN sp.master_product_id = 2604816 THEN 2604816 ELSE sp.master_product_id END limit 500
Bindings:
[7529293,7493489,4991092,4987921,4987920,4987918,4987624,4987231,4985340,4983785,4983613,4546295,4533498,4524189,3771787,2931321,2812735,2752778,2710285,2671026,2670964,2666758,2666106,2664001,2656726,2633097,2604820,2604816,2257475,2190128,1456754,1454930,97564,703893,2666480,112362,112366,112361,0,751,1121,1250,1260,618,459,676,675,677,124,232,318,409]
#9
⏱️ 14.17 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[530703,592247,1031162,1495741,1493093,68135048,33524283,2376716,33528957,2378550,2373478,2378572,2378580,2378608,68135564,68145893,2368414,2378569,31401100,31404135,2917248,11445634,2917228,2917232,2919291,75450029,11434152,11462280,11465644,3223255,3223427,3224982,3226873,3227266,3227560,3227562,3227563,3230734,6795149,1746548,1746553,29138226,6792683,1744852,6797001,6799916,6800615,6790758,32905027,6795987,26447442,1746549]
#10
⏱️ 5.19 мс
select * from "stores" where "stores"."id" in (124, 232, 318, 409, 459, 618, 751)
#11
⏱️ 3.76 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["bat-yam"]
#12
⏱️ 4.51 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 7.88 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]