#1
⏱️ 124.52 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"kfar-saba"]
#2
⏱️ 508.42 мс
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",740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392,true,740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392,"produce"]
#3
⏱️ 346.99 мс
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",740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392,true,740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392,"produce"]
#4
⏱️ 10.61 мс
select * from "canonical_products" where "canonical_products"."id" in (57, 79, 94, 111, 136, 181, 193, 215, 265, 326)
#5
⏱️ 8.67 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[193,181,57,326,136,94,215,111,79,265]
#6
⏱️ 370.44 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775532,8775509,7529293,7514223,7493489,7429691,4681547,4492500,4041677,4033150,4020138,3986687,3977492,3971484,3971460,3971325,3700048,2931321,2812350,2671473,2641760,2633097,2604820,2257475,2190128,1962114,1455907,1454889,1428874,992455,992434,367055,4148882,2261290,162805,4415637,154967,162154,3253825,97564,2191445,703893,149284,109335,134042,155798,4259731,3569061,166942,112144,112362,112366,97562,100349,100288,true,740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392]
#7
⏱️ 12.36 мс
select * from "stores" where "stores"."id" in (25, 141, 295, 302, 317, 329, 354, 368, 392, 740)
#8
⏱️ 42.63 мс
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 = 4148882 THEN 4041677 WHEN sp.master_product_id = 2261290 THEN 4041677 WHEN sp.master_product_id = 162805 THEN 4041677 WHEN sp.master_product_id = 4041677 THEN 4041677 WHEN sp.master_product_id = 4415637 THEN 4041677 WHEN sp.master_product_id = 154967 THEN 4041677 WHEN sp.master_product_id = 162154 THEN 4041677 WHEN sp.master_product_id = 3253825 THEN 4041677 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 = 703893 THEN 2257475 WHEN sp.master_product_id = 2257475 THEN 2257475 WHEN sp.master_product_id = 3971484 THEN 3971484 WHEN sp.master_product_id = 149284 THEN 3971484 WHEN sp.master_product_id = 109335 THEN 3971484 WHEN sp.master_product_id = 134042 THEN 3971484 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 WHEN sp.master_product_id = 992434 THEN 992434 WHEN sp.master_product_id = 97562 THEN 992434 WHEN sp.master_product_id = 100349 THEN 3986687 WHEN sp.master_product_id = 100288 THEN 3986687 WHEN sp.master_product_id = 3986687 THEN 3986687 ELSE sp.master_product_id END limit 500
Bindings:
[8775532,8775509,7529293,7514223,7493489,7429691,4681547,4492500,4041677,4033150,4020138,3986687,3977492,3971484,3971460,3971325,3700048,2931321,2812350,2671473,2641760,2633097,2604820,2257475,2190128,1962114,1455907,1454889,1428874,992455,992434,367055,4148882,2261290,162805,4415637,154967,162154,3253825,97564,2191445,703893,149284,109335,134042,155798,4259731,3569061,166942,112144,112362,112366,97562,100349,100288,0,740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392]
#9
⏱️ 44.86 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1225442,1225444,1228370,5561546,5561548,5563950,663072,663074,665221,5603845,1022691,1022693,1026200,4636221,4636222,4643005,1141985,1138481,1141984,1138483,5205440,1138946,1186104,1186106,1188682,1363172,1363174,1365810,30211807,2515196,12035849,35750342,12040702,31655883,79817557,2581380,30343063,2581929,53104382,2581825,53104377,53107025,30342597,24792238,78376972,59739413,24795221,3574901,3576194,37378801,10848051,3411032,78867627,24491005,3417247,24491626,24490948,3415073,78874351,3415869,9579809,9592068,9559155,3946751,9559615,9612837,3880230,4107743,3946579,9559914,9560420]
#10
⏱️ 11.32 мс
select * from "stores" where "stores"."id" in (25, 141, 295, 302, 317, 329, 354, 368, 392, 478, 498, 556, 584, 740)
#11
⏱️ 5.45 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["kfar-saba"]
#12
⏱️ 5.14 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 7.02 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]