#1
⏱️ 147.36 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"bnei-brak"]
#2
⏱️ 759.25 мс
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",730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298,true,730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298,"produce"]
#3
⏱️ 417.04 мс
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",730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298,true,730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298,"produce"]
#4
⏱️ 15.61 мс
select * from "canonical_products" where "canonical_products"."id" in (79, 94, 181, 193, 215)
#5
⏱️ 22.85 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?)
Bindings:
[193,181,94,215,79]
#6
⏱️ 263.85 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775532,8775509,7556845,7529293,7522489,7514223,7493489,7429691,4681547,3929128,3918545,3700048,3123983,2931321,2812735,2812350,2752778,2710285,2671473,2671026,2670964,2666758,2666106,2664001,2656726,2641760,2633097,2604820,2467713,2190128,2007999,1962114,97564,2191445,155798,4259731,3569061,166942,112144,112362,112366,true,730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298]
#7
⏱️ 12.94 мс
select * from "stores" where "stores"."id" in (84, 86, 135, 282, 285, 288, 298, 730)
#8
⏱️ 41.29 мс
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 = 2191445 THEN 2671473 WHEN sp.master_product_id = 2671473 THEN 2671473 WHEN sp.master_product_id = 155798 THEN 4681547 WHEN sp.master_product_id = 4259731 THEN 4681547 WHEN sp.master_product_id = 3569061 THEN 4681547 WHEN sp.master_product_id = 166942 THEN 4681547 WHEN sp.master_product_id = 112144 THEN 4681547 WHEN sp.master_product_id = 4681547 THEN 4681547 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 ELSE sp.master_product_id END limit 500
Bindings:
[8775532,8775509,7556845,7529293,7522489,7514223,7493489,7429691,4681547,3929128,3918545,3700048,3123983,2931321,2812735,2812350,2752778,2710285,2671473,2671026,2670964,2666758,2666106,2664001,2656726,2641760,2633097,2604820,2467713,2190128,2007999,1962114,97564,2191445,155798,4259731,3569061,166942,112144,112362,112366,0,730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298]
#9
⏱️ 47.53 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4763995,4763991,4721466,4718735,4718732,5896105,5587937,5589827,5589823,5488513,5488509,5250187,5250179,4892469,2053867,2049301,2048517,2050847,2050183,2052263,2055664,38897489,33201541,77675882,38893050,29429294,2053864,2509330,31648372,2509758,2509757,31650073,47563709,72485086,2605601,56639662,47833800,78676994,30365902,12254319,78677002,19025849,12254318,2605583,9559145,3946741,9559605,9612827,4107733,3946569,9559904,9560410,1708466,29090410,6747168,1703402,6748659,1707105,1709712,1710018,1699420,6757345,77346338,29088363,1708464]
#10
⏱️ 16.62 мс
select * from "stores" where "stores"."id" in (84, 86, 135, 282, 285, 288, 298, 432, 477, 502, 730, 748)
#11
⏱️ 10.39 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["bnei-brak"]
#12
⏱️ 7.09 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 12.28 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]