#1
⏱️ 132.1 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"rosh-haayin"]
#2
⏱️ 266.44 мс
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","fruits",33,188,280,71,351,true,33,188,280,71,351,"produce"]
#3
⏱️ 286.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","fruits",33,188,280,71,351,true,33,188,280,71,351,"produce"]
#4
⏱️ 6.16 мс
select * from "canonical_products" where "canonical_products"."id" in (2, 45, 131, 148, 179, 222, 229, 231, 287, 307)
#5
⏱️ 7.21 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[45,222,148,231,131,307,287,2,229,179]
#6
⏱️ 20.03 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?)
Bindings:
[2319509,2051625,2045870,1986970,1986969,1980080,1955245,1954840,1952542,1935825,1935824,1935265,1915305,1912286,1911613,1911330,1910197,1909949,1909908,1909474,1909289,1909168,1908879,1908313,1907954,1907953,1907951,1907944,1907943,1907942,1907932,1907931,1453431,96277,190891,96276,133484,193944,96274,199451,1431173,109470,133481,1456475,1453318,150753,109477,135651,133477,190931,96273,1453432,199385,133495,150728,1463428,true,33,188,280,71,351]
#7
⏱️ 11.55 мс
select * from "stores" where "stores"."id" in (33, 71, 280, 351)
#8
⏱️ 16.86 мс
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 = 1952542 THEN 1952542 WHEN sp.master_product_id = 96277 THEN 1952542 WHEN sp.master_product_id = 1907953 THEN 1907953 WHEN sp.master_product_id = 190891 THEN 1907953 WHEN sp.master_product_id = 96276 THEN 1907953 WHEN sp.master_product_id = 133484 THEN 1907953 WHEN sp.master_product_id = 1908879 THEN 1908879 WHEN sp.master_product_id = 193944 THEN 1908879 WHEN sp.master_product_id = 96274 THEN 1907931 WHEN sp.master_product_id = 199451 THEN 1907931 WHEN sp.master_product_id = 1907931 THEN 1907931 WHEN sp.master_product_id = 1431173 THEN 1907931 WHEN sp.master_product_id = 109470 THEN 1907931 WHEN sp.master_product_id = 133481 THEN 1907931 WHEN sp.master_product_id = 1909168 THEN 1909168 WHEN sp.master_product_id = 1456475 THEN 1909168 WHEN sp.master_product_id = 1907932 THEN 1907932 WHEN sp.master_product_id = 1453318 THEN 1907932 WHEN sp.master_product_id = 150753 THEN 1907954 WHEN sp.master_product_id = 109477 THEN 1907954 WHEN sp.master_product_id = 135651 THEN 1907954 WHEN sp.master_product_id = 133477 THEN 1907954 WHEN sp.master_product_id = 190931 THEN 1907954 WHEN sp.master_product_id = 1907954 THEN 1907954 WHEN sp.master_product_id = 96273 THEN 1907954 WHEN sp.master_product_id = 1453432 THEN 1907943 WHEN sp.master_product_id = 199385 THEN 1907943 WHEN sp.master_product_id = 1907943 THEN 1907943 WHEN sp.master_product_id = 133495 THEN 1907943 WHEN sp.master_product_id = 150728 THEN 1907943 WHEN sp.master_product_id = 1907944 THEN 1907944 WHEN sp.master_product_id = 1463428 THEN 1907944 ELSE sp.master_product_id END limit 500
Bindings:
[2319509,2051625,2045870,1986970,1986969,1980080,1955245,1954840,1952542,1935825,1935824,1935265,1915305,1912286,1911613,1911330,1910197,1909949,1909908,1909474,1909289,1909168,1908879,1908313,1907954,1907953,1907951,1907944,1907943,1907942,1907932,1907931,1453431,96277,190891,96276,133484,193944,96274,199451,1431173,109470,133481,1456475,1453318,150753,109477,135651,133477,190931,96273,1453432,199385,133495,150728,1463428,0,33,188,280,71,351]
#9
⏱️ 7.75 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5566059,5566055,5566062,5566057,5567950,5566060,5577897,6409050,6409053,6409049,6409054,6409051,5650503,5650504,5650515,5650516,5650517,5650524,5650526,5650527,5650921,5656019,5656340,5658327,5658542,5661015,5661053,5663351,5668654,5671227,5673460,5656409,5658790,5663353,5663354,5648437,5660972,5663352,5648438,5650443,5650444,764617,5255512,764619,764616,764620,5255516,5263435]
#10
⏱️ 9.84 мс
select * from "stores" where "stores"."id" in (33, 71, 280, 351)
#11
⏱️ 12.59 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["rosh-haayin"]
#12
⏱️ 7.49 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 5.3 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]