#1
⏱️ 157.6 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"afula"]
#2
⏱️ 474.74 мс
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",599,197,501,121,242,353,true,599,197,501,121,242,353,"produce"]
#3
⏱️ 268.32 мс
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",599,197,501,121,242,353,true,599,197,501,121,242,353,"produce"]
#4
⏱️ 16.92 мс
select * from "canonical_products" where "canonical_products"."id" in (49, 79, 94, 180, 181, 215, 235, 276)
#5
⏱️ 13.21 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[181,276,49,180,94,215,235,79]
#6
⏱️ 118.18 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?)
Bindings:
[7522489,7514223,7493489,4991092,4987921,4987920,4987918,4987624,4987231,4985340,4983785,4983613,4681547,4602029,4526816,4526787,4524189,4401833,3929128,2931321,2812350,2671473,2641760,2633097,2604820,2604816,2190128,1456754,1454928,1454927,1454923,1454921,160600,96257,1456451,157207,162815,154874,149434,2661944,97564,2191445,3855719,1980207,4055598,162816,160964,155798,4259731,3569061,166942,112144,112366,112361,1467932,true,599,197,501,121,242,353]
#7
⏱️ 10.93 мс
select * from "stores" where "stores"."id" in (121, 353)
#8
⏱️ 24.3 мс
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 = 160600 THEN 4526816 WHEN sp.master_product_id = 96257 THEN 4526816 WHEN sp.master_product_id = 1456451 THEN 4526816 WHEN sp.master_product_id = 4526816 THEN 4526816 WHEN sp.master_product_id = 157207 THEN 4526816 WHEN sp.master_product_id = 162815 THEN 4526816 WHEN sp.master_product_id = 154874 THEN 4526816 WHEN sp.master_product_id = 149434 THEN 4526816 WHEN sp.master_product_id = 2661944 THEN 4526816 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 = 3855719 THEN 4526787 WHEN sp.master_product_id = 1980207 THEN 4526787 WHEN sp.master_product_id = 4055598 THEN 4526787 WHEN sp.master_product_id = 162816 THEN 4526787 WHEN sp.master_product_id = 160964 THEN 4526787 WHEN sp.master_product_id = 4526787 THEN 4526787 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 = 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 WHEN sp.master_product_id = 1467932 THEN 4602029 WHEN sp.master_product_id = 4602029 THEN 4602029 ELSE sp.master_product_id END limit 500
Bindings:
[7522489,7514223,7493489,4991092,4987921,4987920,4987918,4987624,4987231,4985340,4983785,4983613,4681547,4602029,4526816,4526787,4524189,4401833,3929128,2931321,2812350,2671473,2641760,2633097,2604820,2604816,2190128,1456754,1454928,1454927,1454923,1454921,160600,96257,1456451,157207,162815,154874,149434,2661944,97564,2191445,3855719,1980207,4055598,162816,160964,155798,4259731,3569061,166942,112144,112366,112361,1467932,0,599,197,501,121,242,353]
#9
⏱️ 34.7 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6400643,6397789,5218265,5213449,2599295,78671252,2599863,19010750,2599665,30359342,19010746,56634825,12241914,62752953,7804819,7804821,7804824,7804825,12085001,7804802,7804806,7808555,75276203,12074799,12074775,7808470,12081750,12087747,3163143,3163313,3164868,3166759,3167152,3167446,3167448,3167449,3170623]
#10
⏱️ 5.86 мс
select * from "stores" where "stores"."id" in (121, 353, 501, 599)
#11
⏱️ 14.75 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["afula"]
#12
⏱️ 20.76 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 14.38 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]