#2
⏱️ 552.32 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_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 (?, ?)))
Bindings:
["bakery",445,623,true,445,623]
#3
⏱️ 40.94 мс
select * from "master_products" where "barcode" is not null and "category_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 (?, ?))) 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:
["bakery",445,623,true,445,623]
#4
⏱️ 2.2 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[4990373,4990354,4988698,4986854,4986434,4986375,4985087,4984384,4984011,4983844,4580835,2987291,2800073,2721111,2657597,2631399,1147560,896167,784004,249189,249034,198452,196266,193704,192180,192179,191906,191839,191491,185455,179202,168075,true,445,623]
#5
⏱️ 2.31 мс
select * from "store_prices" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "price" > ? and "store_id" in (?, ?)
Bindings:
[4990373,4990354,4988698,4986854,4986434,4986375,4985087,4984384,4984011,4983844,4580835,2987291,2800073,2721111,2657597,2631399,1147560,896167,784004,249189,249034,198452,196266,193704,192180,192179,191906,191839,191491,185455,179202,168075,0,445,623]
#8
⏱️ 3.33 мс
select store_id, count(*) as total from "deals" where "store_id" in (?, ?) and "is_active" = ? and ("expires_at" is null or "expires_at" >= ?) group by "store_id"
Bindings:
[445,623,true,"2026-10-22T23:10:59.378663Z"]