#1
⏱️ 144.2 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"safed"]
#2
⏱️ 739.22 мс
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 (?, ?))) 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
⏱️ 497.85 мс
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 (?, ?))) 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
⏱️ 14.72 мс
select * from "canonical_products" where "canonical_products"."id" in (6, 79, 80, 121, 146, 148, 222, 246, 352)
#5
⏱️ 11.69 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[80,79,146,352,246,121,222,6,148]
#6
⏱️ 38.41 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[2257916,2190661,2190128,2151263,2136438,2045870,1987013,1966954,1962114,1943841,1935265,1928902,1926920,1926121,1926120,1920468,1912369,1912226,1912088,1912087,1911874,1911613,1910399,1910173,1910051,1909908,1909819,1909168,1909143,1909142,1909047,1908879,198874,97564,109889,164584,1432304,598075,133504,111462,193944,1456475,160117,166132,112423,109863,true,101,275]
#7
⏱️ 6.72 мс
select * from "stores" where "stores"."id" in (101, 275)
#8
⏱️ 20.11 мс
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 = 2190128 THEN 2190128 WHEN sp.master_product_id = 97564 THEN 2190128 WHEN sp.master_product_id = 2190661 THEN 2190661 WHEN sp.master_product_id = 109889 THEN 2190661 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 = 193944 THEN 1908879 WHEN sp.master_product_id = 1908879 THEN 1908879 WHEN sp.master_product_id = 1909168 THEN 1909168 WHEN sp.master_product_id = 1456475 THEN 1909168 WHEN sp.master_product_id = 160117 THEN 1926920 WHEN sp.master_product_id = 1926920 THEN 1926920 WHEN sp.master_product_id = 166132 THEN 1926920 WHEN sp.master_product_id = 112423 THEN 1943841 WHEN sp.master_product_id = 109863 THEN 1943841 WHEN sp.master_product_id = 1943841 THEN 1943841 ELSE sp.master_product_id END limit 500
Bindings:
[2257916,2190661,2190128,2151263,2136438,2045870,1987013,1966954,1962114,1943841,1935265,1928902,1926920,1926121,1926120,1920468,1912369,1912226,1912088,1912087,1911874,1911613,1910399,1910173,1910051,1909908,1909819,1909168,1909143,1909142,1909047,1908879,198874,97564,109889,164584,1432304,598075,133504,111462,193944,1456475,160117,166132,112423,109863,0,101,275]
#9
⏱️ 22.09 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6213219,6213213,45864393,21305074,6216273,80149402,70746631,5383938,5384109,5384212,5384214,5384242,5388079,5388162,5388311,5389966,5390245,5398116,5398375,5400194,5400195,5400381,5400633,5378748,5374029,5374030,5378678,5387986,5386308,56690984,5388054,5378615,5378648]
#10
⏱️ 10.38 мс
select * from "stores" where "stores"."id" in (101, 275)
#11
⏱️ 9.59 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["safed"]
#12
⏱️ 6.22 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 7.99 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]