#1
⏱️ 220.3 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"safed"]
#2
⏱️ 437.86 мс
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","vegetables",101,275,true,101,275,"produce"]
#3
⏱️ 161.79 мс
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","vegetables",101,275,true,101,275,"produce"]
#4
⏱️ 12.99 мс
select * from "canonical_products" where "canonical_products"."id" in (6, 20, 64, 240, 246)
#5
⏱️ 7.7 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?)
Bindings:
[246,6,240,20,64]
#6
⏱️ 26.48 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[1955549,1928902,1926920,1926121,1926120,1918287,1916627,1912226,1912018,1910474,1909865,1909819,1909369,1909358,1909143,1909047,1908728,1908616,1908615,1908153,1908144,1907939,1907935,1907934,1907417,1879254,1465150,1464670,1462249,1458610,1458545,1458424,198874,1464228,195142,130435,274698,160117,166132,true,101,275]
#7
⏱️ 8.66 мс
select * from "stores" where "stores"."id" in (101, 275)
#8
⏱️ 12.48 мс
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 = 1909143 THEN 1909143 WHEN sp.master_product_id = 198874 THEN 1909143 WHEN sp.master_product_id = 1907935 THEN 1907935 WHEN sp.master_product_id = 1464228 THEN 1907935 WHEN sp.master_product_id = 195142 THEN 1907935 WHEN sp.master_product_id = 130435 THEN 1465150 WHEN sp.master_product_id = 1465150 THEN 1465150 WHEN sp.master_product_id = 274698 THEN 1908728 WHEN sp.master_product_id = 1908728 THEN 1908728 WHEN sp.master_product_id = 1926920 THEN 1926920 WHEN sp.master_product_id = 160117 THEN 1926920 WHEN sp.master_product_id = 166132 THEN 1926920 ELSE sp.master_product_id END limit 500
Bindings:
[1955549,1928902,1926920,1926121,1926120,1918287,1916627,1912226,1912018,1910474,1909865,1909819,1909369,1909358,1909143,1909047,1908728,1908616,1908615,1908153,1908144,1907939,1907935,1907934,1907417,1879254,1465150,1464670,1462249,1458610,1458545,1458424,198874,1464228,195142,130435,274698,160117,166132,0,101,275]
#9
⏱️ 13.07 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6211642,5390202,5390304,5390365,5374040,5381504,5383996,5376109,5374185,5378664,5378665,5378669,5378911,5378920,5381447,5381448,5381562,5384109,5384214,5385954,5385965,5388079,5388116,5390334,5400078,5400381,5390216,5398361,5374029,5374030,5378678,5387986,5390277]
#10
⏱️ 14.79 мс
select * from "stores" where "stores"."id" in (101, 275)
#11
⏱️ 3.81 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["safed"]
#12
⏱️ 12.99 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 11.9 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]