#1
⏱️ 129.25 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"kiryat-shmona"]
#2
⏱️ 551.73 мс
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","fruits",125,452,true,125,452,"produce"]
#3
⏱️ 196.78 мс
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","fruits",125,452,true,125,452,"produce"]
#4
⏱️ 13.5 мс
select * from "canonical_products" where "canonical_products"."id" in (30, 78, 80, 252)
#5
⏱️ 9.96 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?)
Bindings:
[30,78,252,80]
#6
⏱️ 12.63 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[2996211,2975219,2974530,2677371,2671011,2670954,2670949,2670946,2668399,2662799,2662570,2662130,2647242,2637097,2632033,2631970,2257916,2190661,2151263,2136438,2045870,1879673,1455743,1455203,1453435,639411,598059,497990,496460,362409,327734,327732,1933366,1453321,156941,158420,109889,150751,133528,1452766,1879659,true,125,452]
#7
⏱️ 4.2 мс
select * from "stores" where "stores"."id" in (125)
#8
⏱️ 13.66 мс
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 = 1933366 THEN 2670949 WHEN sp.master_product_id = 2670949 THEN 2670949 WHEN sp.master_product_id = 2647242 THEN 2647242 WHEN sp.master_product_id = 1453321 THEN 2647242 WHEN sp.master_product_id = 156941 THEN 2647242 WHEN sp.master_product_id = 158420 THEN 2647242 WHEN sp.master_product_id = 2190661 THEN 2190661 WHEN sp.master_product_id = 109889 THEN 2190661 WHEN sp.master_product_id = 150751 THEN 2637097 WHEN sp.master_product_id = 133528 THEN 2637097 WHEN sp.master_product_id = 1452766 THEN 2637097 WHEN sp.master_product_id = 1879659 THEN 2637097 WHEN sp.master_product_id = 2637097 THEN 2637097 ELSE sp.master_product_id END limit 500
Bindings:
[2996211,2975219,2974530,2677371,2671011,2670954,2670949,2670946,2668399,2662799,2662570,2662130,2647242,2637097,2632033,2631970,2257916,2190661,2151263,2136438,2045870,1879673,1455743,1455203,1453435,639411,598059,497990,496460,362409,327734,327732,1933366,1453321,156941,158420,109889,150751,133528,1452766,1879659,0,125,452]
#9
⏱️ 16.47 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[22287100,6257795,6250872,6250885,80243263,2298587,31330826,2298485,2298524,2298468,11239815,11223789,11225039,11225246,11239826,11211280,15884835,15887382,11219940,31331956,11222083,33459086,11219947]
#10
⏱️ 9.2 мс
select * from "stores" where "stores"."id" in (125, 452)
#11
⏱️ 10.82 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["kiryat-shmona"]
#12
⏱️ 9.27 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 20.17 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]