#1
⏱️ 293.96 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"tiberias"]
#2
⏱️ 486.43 мс
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",756,633,true,756,633,"produce"]
#3
⏱️ 395.6 мс
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",756,633,true,756,633,"produce"]
#4
⏱️ 27.62 мс
select * from "canonical_products" where "canonical_products"."id" in (87, 121, 140, 162, 215, 228, 257, 276, 279, 286, 297)
#5
⏱️ 23.6 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[228,140,87,257,279,276,286,162,215,121,297]
#6
⏱️ 31.8 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[4678136,4658871,4658870,4658869,4658868,4602029,4546301,4546295,4546279,4546265,4279044,2710285,2671026,2670964,2666758,2666027,2664001,2641760,2633097,2631399,2604820,1916175,1910399,1454503,205447,204701,196052,194313,193892,193890,192267,192250,195121,207015,110668,164584,207016,195120,110465,2666480,112366,195117,111088,109484,109821,207014,195119,1467932,207013,195118,149430,112363,true,756,633]
#7
⏱️ 41.97 мс
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 = 195121 THEN 4658870 WHEN sp.master_product_id = 4658870 THEN 4658870 WHEN sp.master_product_id = 207015 THEN 4658870 WHEN sp.master_product_id = 110668 THEN 4658870 WHEN sp.master_product_id = 1910399 THEN 1910399 WHEN sp.master_product_id = 164584 THEN 1910399 WHEN sp.master_product_id = 4658871 THEN 4658871 WHEN sp.master_product_id = 207016 THEN 4658871 WHEN sp.master_product_id = 195120 THEN 4658871 WHEN sp.master_product_id = 110465 THEN 4658871 WHEN sp.master_product_id = 4546295 THEN 4546295 WHEN sp.master_product_id = 2666480 THEN 4546295 WHEN sp.master_product_id = 112366 THEN 2604820 WHEN sp.master_product_id = 2604820 THEN 2604820 WHEN sp.master_product_id = 4678136 THEN 4678136 WHEN sp.master_product_id = 195117 THEN 4678136 WHEN sp.master_product_id = 111088 THEN 4678136 WHEN sp.master_product_id = 109484 THEN 4678136 WHEN sp.master_product_id = 109821 THEN 4678136 WHEN sp.master_product_id = 207014 THEN 4658869 WHEN sp.master_product_id = 195119 THEN 4658869 WHEN sp.master_product_id = 4658869 THEN 4658869 WHEN sp.master_product_id = 4602029 THEN 4602029 WHEN sp.master_product_id = 1467932 THEN 4602029 WHEN sp.master_product_id = 4658868 THEN 4658868 WHEN sp.master_product_id = 207013 THEN 4658868 WHEN sp.master_product_id = 195118 THEN 4658868 WHEN sp.master_product_id = 4546301 THEN 4546301 WHEN sp.master_product_id = 149430 THEN 4546301 WHEN sp.master_product_id = 193890 THEN 193890 WHEN sp.master_product_id = 112363 THEN 193890 ELSE sp.master_product_id END limit 500
Bindings:
[4678136,4658871,4658870,4658869,4658868,4602029,4546301,4546295,4546279,4546265,4279044,2710285,2671026,2670964,2666758,2666027,2664001,2641760,2633097,2631399,2604820,1916175,1910399,1454503,205447,204701,196052,194313,193892,193890,192267,192250,195121,207015,110668,164584,207016,195120,110465,2666480,112366,195117,111088,109484,109821,207014,195119,1467932,207013,195118,149430,112363,0,756,633]
#8
⏱️ 31.35 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2958380,2958399,2959813,2959815,2960208,2961904,2958840,2961843,2961221,2961079,2959964,2956511,2966105,2966119,2966134,2966140,2961029,2961611,2961612,2959962,2959961,2957845,1807159,1806350,1815352,1808105,1816124,1814311,1807656,1809718,1816962,1816989,1817002,1817033,1817096,1807759,1816995,1818492]
#9
⏱️ 25.16 мс
select * from "stores" where "stores"."id" in (633, 756)
#10
⏱️ 15.54 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["tiberias"]
#11
⏱️ 31.07 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#12
⏱️ 28.26 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]