#1
⏱️ 108.17 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"nahariya"]
#2
⏱️ 250.48 мс
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",766,1123,1254,410,446,1362,10,241,true,766,1123,1254,410,446,1362,10,241,"produce"]
#3
⏱️ 190.19 мс
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",766,1123,1254,410,446,1362,10,241,true,766,1123,1254,410,446,1362,10,241,"produce"]
#4
⏱️ 12 мс
select * from "canonical_products" where "canonical_products"."id" in (13)
#5
⏱️ 4.12 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?)
Bindings:
[13]
#6
⏱️ 9.11 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[7182537,2812735,2710285,2671026,2670964,2666758,2666027,2664001,2633097,2631399,365009,287107,287105,265106,265105,265104,255191,192267,192250,192249,135363,134805,133996,133831,133799,133798,133797,133796,133737,133233,133231,133225,99982,true,766,1123,1254,410,446,1362,10,241]
#7
⏱️ 7.41 мс
select * from "stores" where "stores"."id" in (10, 410)
#8
⏱️ 12.08 мс
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 = 99982 THEN 135363 WHEN sp.master_product_id = 135363 THEN 135363 ELSE sp.master_product_id END limit 500
Bindings:
[7182537,2812735,2710285,2671026,2670964,2666758,2666027,2664001,2633097,2631399,365009,287107,287105,265106,265105,265104,255191,192267,192250,192249,135363,134805,133996,133831,133799,133798,133797,133796,133737,133233,133231,133225,99982,0,766,1123,1254,410,446,1362,10,241]
#9
⏱️ 8.57 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[817902,6250381,926944,925150,1507137,5128045,5128044,5128046,2235266,2235326,2235591,2236411,2235939,2235940,2235941,2235942,2236518,2236270,2230628,2236443,2234494,2225930,2226221,2226684,2230607,2232382,2234609,2235504,2226740,2226860,2226722,2231680,2231275,520845,520969,520970,520971]
#10
⏱️ 8.18 мс
select * from "stores" where "stores"."id" in (10, 241, 410, 446, 766)
#11
⏱️ 10.66 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["nahariya"]
#12
⏱️ 8.17 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 7.43 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]