#1
⏱️ 146.2 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"safed"]
#2
⏱️ 494.99 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_slug" = ? and "master_products"."id" in ((select "master_product_id" from "store_prices" where "store_id" in (?, ?)) union (select "master_product_id" from "deals" where "is_active" = ? and "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",101,275,true,101,275,"produce"]
#3
⏱️ 344.7 мс
select * from "master_products" where "barcode" is not null and "category_slug" = ? and "master_products"."id" in ((select "master_product_id" from "store_prices" where "store_id" in (?, ?)) union (select "master_product_id" from "deals" where "is_active" = ? and "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",101,275,true,101,275,"produce"]
#4
⏱️ 11.7 мс
select * from "canonical_products" where "canonical_products"."id" in (121, 146, 246)
#5
⏱️ 5.16 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?)
Bindings:
[146,246,121]
#6
⏱️ 14.92 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[2045870,1987013,1966954,1962114,1962021,1955549,1935265,1928902,1926920,1926121,1926120,1920468,1918287,1916627,1912369,1912286,1912226,1912088,1912087,1912018,1912003,1911972,1911613,1911330,1910474,1910399,1910197,1909949,1909908,1909873,1909866,1909865,164584,1432304,598075,133504,111462,160117,166132,true,101,275]
#7
⏱️ 3.29 мс
select * from "stores" where "stores"."id" in (101, 275)
#8
⏱️ 16.21 мс
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 = 1910399 THEN 1910399 WHEN sp.master_product_id = 164584 THEN 1910399 WHEN sp.master_product_id = 1432304 THEN 1987013 WHEN sp.master_product_id = 1987013 THEN 1987013 WHEN sp.master_product_id = 598075 THEN 1987013 WHEN sp.master_product_id = 133504 THEN 1987013 WHEN sp.master_product_id = 111462 THEN 1987013 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:
[2045870,1987013,1966954,1962114,1962021,1955549,1935265,1928902,1926920,1926121,1926120,1920468,1918287,1916627,1912369,1912286,1912226,1912088,1912087,1912018,1912003,1911972,1911613,1911330,1910474,1910399,1910197,1909949,1909908,1909873,1909866,1909865,164584,1432304,598075,133504,111462,160117,166132,0,101,275]
#9
⏱️ 23.32 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6213219,6213213,5388116,5388117,5388124,5388162,5388201,5389988,5390245,5390334,5395782,5398116,8318271,5400063,5400078,5400194,5400195,5400381,5400505,5400633,5390216,5398361,5378748,5374029,5374030,5378678,5387986,5386308,5390277,5387973,5388054,5378615,5378648]
#10
⏱️ 10.66 мс
select * from "stores" where "stores"."id" in (101, 275)
#11
⏱️ 6.24 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["safed"]
#12
⏱️ 2.02 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 4.23 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]