#1
⏱️ 133.12 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"yavne"]
#2
⏱️ 449.74 мс
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",161,667,17,82,true,161,667,17,82,"produce"]
#3
⏱️ 318.99 мс
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",161,667,17,82,true,161,667,17,82,"produce"]
#4
⏱️ 7.45 мс
select * from "canonical_products" where "canonical_products"."id" in (6, 20, 63, 82, 183, 266, 347)
#5
⏱️ 9.62 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?)
Bindings:
[6,20,347,183,63,266,82]
#6
⏱️ 4.04 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[1954257,1922388,1916175,1915867,1912226,1911874,1910173,1910051,1909143,1907939,1907935,1907934,1907928,1907417,1879254,1462306,1458545,1457124,1457123,1457122,1457121,1455921,1455917,1454932,1454908,1452801,1452800,1223804,959071,496502,156536,133614,198874,1464228,195142,1454903,109243,134681,150736,190899,1454238,364246,1454924,true,161,667,17,82]
#7
⏱️ 3.6 мс
select * from "stores" where "stores"."id" in (17, 82)
#8
⏱️ 5.42 мс
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 = 1464228 THEN 1907935 WHEN sp.master_product_id = 195142 THEN 1907935 WHEN sp.master_product_id = 1907935 THEN 1907935 WHEN sp.master_product_id = 1454932 THEN 1454932 WHEN sp.master_product_id = 1454903 THEN 1454932 WHEN sp.master_product_id = 109243 THEN 496502 WHEN sp.master_product_id = 496502 THEN 496502 WHEN sp.master_product_id = 134681 THEN 496502 WHEN sp.master_product_id = 150736 THEN 496502 WHEN sp.master_product_id = 190899 THEN 496502 WHEN sp.master_product_id = 1455921 THEN 1455921 WHEN sp.master_product_id = 1454238 THEN 1455921 WHEN sp.master_product_id = 364246 THEN 959071 WHEN sp.master_product_id = 959071 THEN 959071 WHEN sp.master_product_id = 1462306 THEN 1462306 WHEN sp.master_product_id = 1454924 THEN 1462306 ELSE sp.master_product_id END limit 500
Bindings:
[1954257,1922388,1916175,1915867,1912226,1911874,1910173,1910051,1909143,1907939,1907935,1907934,1907928,1907417,1879254,1462306,1458545,1457124,1457123,1457122,1457121,1455921,1455917,1454932,1454908,1452801,1452800,1223804,959071,496502,156536,133614,198874,1464228,195142,1454903,109243,134681,150736,190899,1454238,364246,1454924,0,161,667,17,82]
#9
⏱️ 8.81 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6093667,70713835,22178473,6088775,4849873,4837493,4837500,4837501,4840414,4840415,4843162,4843163,4843435,4843436,4843437,4843438,4846864,4837321,4837396,4840057,4840061,4840062,4840066,4843160,4846394,4846501,4851755,4852126,4843474,4843492]
#10
⏱️ 5.16 мс
select * from "stores" where "stores"."id" in (17, 82)
#11
⏱️ 9.14 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["yavne"]
#12
⏱️ 6.1 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 3.69 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]