#1
⏱️ 186.66 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"kiryat-gat"]
#2
⏱️ 509.61 мс
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",90,471,243,true,90,471,243,"produce"]
#3
⏱️ 278.69 мс
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",90,471,243,true,90,471,243,"produce"]
#4
⏱️ 6.65 мс
select * from "canonical_products" where "canonical_products"."id" in (2, 41, 131, 179, 209, 229, 231, 264, 287, 355)
#5
⏱️ 5.62 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[231,131,287,2,229,179,209,355,41,264]
#6
⏱️ 11.37 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?)
Bindings:
[7430884,2631970,2047938,2046307,1920468,1912286,1911972,1910197,1909949,1909873,1909866,1909474,1909289,1907954,1907953,1907951,1907943,1907942,1907932,1907931,1907928,1907926,1907923,1907901,1907898,1480473,1462893,1461585,1461069,1461068,1461067,1458529,1453431,110100,1431171,170225,190786,135652,190891,96276,133484,96274,199451,1431173,109470,133481,96300,133478,150752,109601,191005,1431175,1453318,150753,109477,135651,133477,190931,96273,98914,1453432,199385,133495,150728,8918271,true,90,471,243]
#7
⏱️ 9.43 мс
select * from "stores" where "stores"."id" in (90, 243)
#8
⏱️ 17.81 мс
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 = 110100 THEN 1907901 WHEN sp.master_product_id = 1431171 THEN 1907901 WHEN sp.master_product_id = 170225 THEN 1907901 WHEN sp.master_product_id = 1907901 THEN 1907901 WHEN sp.master_product_id = 190786 THEN 1907901 WHEN sp.master_product_id = 135652 THEN 1907901 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 = 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 = 96300 THEN 1907926 WHEN sp.master_product_id = 133478 THEN 1907926 WHEN sp.master_product_id = 150752 THEN 1907926 WHEN sp.master_product_id = 109601 THEN 1907926 WHEN sp.master_product_id = 191005 THEN 1907926 WHEN sp.master_product_id = 1431175 THEN 1907926 WHEN sp.master_product_id = 1907926 THEN 1907926 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 = 1458529 THEN 1458529 WHEN sp.master_product_id = 98914 THEN 1458529 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 = 8918271 THEN 1907923 WHEN sp.master_product_id = 1907923 THEN 1907923 ELSE sp.master_product_id END limit 500
Bindings:
[7430884,2631970,2047938,2046307,1920468,1912286,1911972,1910197,1909949,1909873,1909866,1909474,1909289,1907954,1907953,1907951,1907943,1907942,1907932,1907931,1907928,1907926,1907923,1907901,1907898,1480473,1462893,1461585,1461069,1461068,1461067,1458529,1453431,110100,1431171,170225,190786,135652,190891,96276,133484,96274,199451,1431173,109470,133481,96300,133478,150752,109601,191005,1431175,1453318,150753,109477,135651,133477,190931,96273,98914,1453432,199385,133495,150728,8918271,0,90,471,243]
#9
⏱️ 14.53 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4823636,4833617,4833618,4833619,4833796,4811567,4813929,4813931,4813948,4813951,4813953,4813956,4813957,4813967,4813968,4813975,4813977,4813978,4820319,4820454,4820694,4820701,4820745,4823439,4832227,4832441,4814007,5397600,2478980,2481589,2481495,2481498,2481509,2481501,2481494,2481438,2481470,2481545,2479622]
#10
⏱️ 9.25 мс
select * from "stores" where "stores"."id" in (90, 243, 471)
#11
⏱️ 6.91 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["kiryat-gat"]
#12
⏱️ 7.71 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 8.22 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]