#1
⏱️ 74.71 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"givatayim"]
#2
⏱️ 236.69 мс
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",1118,1181,1221,1290,16,14,38,118,261,212,226,231,292,431,454,458,492,493,567,663,672,683,687,32,73,4,223,true,1118,1181,1221,1290,16,14,38,118,261,212,226,231,292,431,454,458,492,493,567,663,672,683,687,32,73,4,223,"produce"]
#3
⏱️ 240.78 мс
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",1118,1181,1221,1290,16,14,38,118,261,212,226,231,292,431,454,458,492,493,567,663,672,683,687,32,73,4,223,true,1118,1181,1221,1290,16,14,38,118,261,212,226,231,292,431,454,458,492,493,567,663,672,683,687,32,73,4,223,"produce"]
#4
⏱️ 8.39 мс
select * from "canonical_products" where "canonical_products"."id" in (12, 78, 83, 171, 182, 187, 252)
#5
⏱️ 10.47 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?)
Bindings:
[171,83,12,182,187,78,252]
#6
⏱️ 64 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[7509887,7508207,7502589,7452710,7439517,4110824,4078589,4066766,3709706,3411661,3087552,2815577,2715904,2682071,2681942,2680174,2671353,2671011,2670954,2670946,2668399,2666943,2666106,2662799,2662570,2662130,2647242,2637097,2634735,2633336,2632033,2631970,2956794,1453321,156941,158420,946602,2666686,149227,2045916,157118,157278,155793,1960939,10941098,150751,1452766,133528,1879659,true,1118,1181,1221,1290,16,14,38,118,261,212,226,231,292,431,454,458,492,493,567,663,672,683,687,32,73,4,223]
#7
⏱️ 7 мс
select * from "stores" where "stores"."id" in (73)
#8
⏱️ 24.19 мс
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 = 2956794 THEN 3411661 WHEN sp.master_product_id = 3411661 THEN 3411661 WHEN sp.master_product_id = 1453321 THEN 2647242 WHEN sp.master_product_id = 2647242 THEN 2647242 WHEN sp.master_product_id = 156941 THEN 2647242 WHEN sp.master_product_id = 158420 THEN 2647242 WHEN sp.master_product_id = 946602 THEN 3709706 WHEN sp.master_product_id = 3709706 THEN 3709706 WHEN sp.master_product_id = 2666686 THEN 3709706 WHEN sp.master_product_id = 149227 THEN 3709706 WHEN sp.master_product_id = 2045916 THEN 4110824 WHEN sp.master_product_id = 4110824 THEN 4110824 WHEN sp.master_product_id = 157118 THEN 4110824 WHEN sp.master_product_id = 157278 THEN 4110824 WHEN sp.master_product_id = 155793 THEN 4110824 WHEN sp.master_product_id = 2681942 THEN 2681942 WHEN sp.master_product_id = 1960939 THEN 2681942 WHEN sp.master_product_id = 2666943 THEN 2666943 WHEN sp.master_product_id = 10941098 THEN 2666943 WHEN sp.master_product_id = 150751 THEN 2637097 WHEN sp.master_product_id = 1452766 THEN 2637097 WHEN sp.master_product_id = 133528 THEN 2637097 WHEN sp.master_product_id = 1879659 THEN 2637097 WHEN sp.master_product_id = 2637097 THEN 2637097 ELSE sp.master_product_id END limit 500
Bindings:
[7509887,7508207,7502589,7452710,7439517,4110824,4078589,4066766,3709706,3411661,3087552,2815577,2715904,2682071,2681942,2680174,2671353,2671011,2670954,2670946,2668399,2666943,2666106,2662799,2662570,2662130,2647242,2637097,2634735,2633336,2632033,2631970,2956794,1453321,156941,158420,946602,2666686,149227,2045916,157118,157278,155793,1960939,10941098,150751,1452766,133528,1879659,0,1118,1181,1221,1290,16,14,38,118,261,212,226,231,292,431,454,458,492,493,567,663,672,683,687,32,73,4,223]
#9
⏱️ 23.95 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1613548,1614021,1615413,4557483,2041727,2041747,2029410,2036036,2041715,2041757,2038835,2041767,2036028,2039708,2037305,2310239,2310255,2306857,2310229,2304786,2307716,2307950,2308329,2314437,2304792,2314446,2314452,2314509,2315931,2310269,2313672,2315398,2310540,2356664,2356819,2356650,2356842,2363561,2360294,2359626,2556383,2556396,2556373,2556409,2558819,2554548,2556945,2558625,2562039,2562027,2562067,2560480,2558877,3623957,3625965,3623980,3624594]
#10
⏱️ 4.99 мс
select * from "stores" where "stores"."id" in (16, 73, 431, 454, 458, 492, 493, 567)
#11
⏱️ 6.22 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["givatayim"]
#12
⏱️ 7.05 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 6.25 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]