#1
⏱️ 151.7 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"yavne"]
#2
⏱️ 951.43 мс
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",161,667,17,82,true,161,667,17,82,"produce"]
#3
⏱️ 781.48 мс
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",161,667,17,82,true,161,667,17,82,"produce"]
#4
⏱️ 15.39 мс
select * from "canonical_products" where "canonical_products"."id" in (2, 6, 20, 121, 131, 179, 209, 231, 355)
#5
⏱️ 12.42 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[121,6,231,131,2,20,179,209,355]
#6
⏱️ 30.34 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[2257916,2159512,2151263,2136438,2045870,1962114,1954569,1954257,1922388,1916175,1915867,1912369,1912226,1912088,1912087,1911874,1910399,1910173,1910051,1909143,1909142,1907954,1907953,1907951,1907942,1907939,1907935,1907934,1907931,1907928,1907926,1907923,1453431,198874,1464228,195142,164584,133484,190891,96276,133481,96274,199451,1431173,109470,96300,133478,109601,150752,1431175,191005,96273,133477,109477,150753,190931,135651,8918271,true,161,667,17,82]
#7
⏱️ 3.3 мс
select * from "stores" where "stores"."id" in (17, 82)
#8
⏱️ 21.26 мс
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 = 1907942 THEN 1907942 WHEN sp.master_product_id = 1453431 THEN 1907942 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 = 1910399 THEN 1910399 WHEN sp.master_product_id = 164584 THEN 1910399 WHEN sp.master_product_id = 1907953 THEN 1907953 WHEN sp.master_product_id = 133484 THEN 1907953 WHEN sp.master_product_id = 190891 THEN 1907953 WHEN sp.master_product_id = 96276 THEN 1907953 WHEN sp.master_product_id = 133481 THEN 1907931 WHEN sp.master_product_id = 1907931 THEN 1907931 WHEN sp.master_product_id = 96274 THEN 1907931 WHEN sp.master_product_id = 199451 THEN 1907931 WHEN sp.master_product_id = 1431173 THEN 1907931 WHEN sp.master_product_id = 109470 THEN 1907931 WHEN sp.master_product_id = 96300 THEN 1907926 WHEN sp.master_product_id = 133478 THEN 1907926 WHEN sp.master_product_id = 109601 THEN 1907926 WHEN sp.master_product_id = 150752 THEN 1907926 WHEN sp.master_product_id = 1431175 THEN 1907926 WHEN sp.master_product_id = 1907926 THEN 1907926 WHEN sp.master_product_id = 191005 THEN 1907926 WHEN sp.master_product_id = 96273 THEN 1907954 WHEN sp.master_product_id = 133477 THEN 1907954 WHEN sp.master_product_id = 109477 THEN 1907954 WHEN sp.master_product_id = 150753 THEN 1907954 WHEN sp.master_product_id = 190931 THEN 1907954 WHEN sp.master_product_id = 1907954 THEN 1907954 WHEN sp.master_product_id = 135651 THEN 1907954 WHEN sp.master_product_id = 8918271 THEN 1907923 WHEN sp.master_product_id = 1907923 THEN 1907923 ELSE sp.master_product_id END limit 500
Bindings:
[2257916,2159512,2151263,2136438,2045870,1962114,1954569,1954257,1922388,1916175,1915867,1912369,1912226,1912088,1912087,1911874,1910399,1910173,1910051,1909143,1909142,1907954,1907953,1907951,1907942,1907939,1907935,1907934,1907931,1907928,1907926,1907923,1453431,198874,1464228,195142,164584,133484,190891,96276,133481,96274,199451,1431173,109470,96300,133478,109601,150752,1431175,191005,96273,133477,109477,150753,190931,135651,8918271,0,161,667,17,82]
#9
⏱️ 15.09 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[73539104,6093350,6093326,81688909,6093330,6093325,6093327,45831515,14988040,81688936,70713782,4840053,4840055,4840057,4840059,4840061,4840062,4840066,4840069,4840076,4840078,4840079,4843158,4843160,4846394,4846501,4851755,4851982,4851983,4852126,4852193,4843474,4843492,4843433]
#10
⏱️ 12.62 мс
select * from "stores" where "stores"."id" in (17, 82)
#11
⏱️ 15.01 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["yavne"]
#12
⏱️ 13.26 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 17.9 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]