#1
⏱️ 181.02 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"zikhron-yaakov"]
#2
⏱️ 810.91 мс
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",347,443,616,435,true,347,443,616,435,"produce"]
#3
⏱️ 218.05 мс
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",347,443,616,435,true,347,443,616,435,"produce"]
#4
⏱️ 19.59 мс
select * from "canonical_products" where "canonical_products"."id" in (120)
#5
⏱️ 15.11 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?)
Bindings:
[120]
#6
⏱️ 30.07 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[4990823,4990804,4990789,4990619,4990596,4990129,4988681,4988647,4988576,4988219,4987997,4986884,4986467,4986067,4985992,4985413,4985304,4985209,4985017,4984836,4984760,4984537,4984460,4984337,4984311,4984180,4984153,4983780,4983766,4983764,4983762,4983761,4983744,true,347,443,616,435]
#7
⏱️ 19.19 мс
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 = 4983744 THEN 4985413 WHEN sp.master_product_id = 4985413 THEN 4985413 ELSE sp.master_product_id END limit 500
Bindings:
[4990823,4990804,4990789,4990619,4990596,4990129,4988681,4988647,4988576,4988219,4987997,4986884,4986467,4986067,4985992,4985413,4985304,4985209,4985017,4984836,4984760,4984537,4984460,4984337,4984311,4984180,4984153,4983780,4983766,4983764,4983762,4983761,4983744,0,347,443,616,435]
#8
⏱️ 16.88 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[3208333,3208334,3208336,3208338,3208352,3208725,3208752,3208883,3208909,3209032,3209109,3209332,3209408,3209589,3209781,3209876,3208316,3210564,3210639,3211039,3211456,3212569,3212791,3213148,3213219,3213253,3214701,3215168,3215191,3215361,3215376,3215395]
#9
⏱️ 15.52 мс
select * from "stores" where "stores"."id" in (616)
#10
⏱️ 9.33 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["zikhron-yaakov"]
#11
⏱️ 1.39 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#12
⏱️ 7.46 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]