#1
⏱️ 125.36 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"givatayim"]
#2
⏱️ 891.18 мс
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",223,1118,1181,1221,1290,14,38,261,226,292,431,454,458,492,493,567,663,672,683,687,4,16,32,73,118,212,231,true,223,1118,1181,1221,1290,14,38,261,226,292,431,454,458,492,493,567,663,672,683,687,4,16,32,73,118,212,231,"produce"]
#3
⏱️ 513.57 мс
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",223,1118,1181,1221,1290,14,38,261,226,292,431,454,458,492,493,567,663,672,683,687,4,16,32,73,118,212,231,true,223,1118,1181,1221,1290,14,38,261,226,292,431,454,458,492,493,567,663,672,683,687,4,16,32,73,118,212,231,"produce"]
#4
⏱️ 4.58 мс
select * from "canonical_products" where "canonical_products"."id" in (53, 71, 84, 90, 117, 159, 172, 194)
#5
⏱️ 1.46 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[159,194,172,71,84,53,90,117]
#6
⏱️ 114.83 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[7561917,7529435,7513702,7477797,7472471,7466366,7461021,7455068,7446739,7431628,6908951,6744655,6708345,6571261,4302537,4116124,4094723,4094721,4093867,4064767,4064694,4047733,4046320,4039527,4039525,4039359,4020207,4016585,4004803,3982444,3979153,3977494,154964,1909820,2927777,134045,1454922,165505,1458061,1909941,1930007,205836,112818,127440,129463,9960259,4546323,149368,2663583,195947,1941919,1456452,157276,191901,157163,2902166,3482419,4029456,true,223,1118,1181,1221,1290,14,38,261,226,292,431,454,458,492,493,567,663,672,683,687,4,16,32,73,118,212,231]
#7
⏱️ 1.94 мс
select * from "stores" where "stores"."id" in (73)
#8
⏱️ 11.18 мс
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 = 154964 THEN 4064767 WHEN sp.master_product_id = 4064767 THEN 4064767 WHEN sp.master_product_id = 1909820 THEN 7477797 WHEN sp.master_product_id = 2927777 THEN 7477797 WHEN sp.master_product_id = 7477797 THEN 7477797 WHEN sp.master_product_id = 134045 THEN 7477797 WHEN sp.master_product_id = 1454922 THEN 7461021 WHEN sp.master_product_id = 7461021 THEN 7461021 WHEN sp.master_product_id = 165505 THEN 7461021 WHEN sp.master_product_id = 1458061 THEN 4039359 WHEN sp.master_product_id = 1909941 THEN 4039359 WHEN sp.master_product_id = 1930007 THEN 4039359 WHEN sp.master_product_id = 205836 THEN 4039359 WHEN sp.master_product_id = 112818 THEN 4039359 WHEN sp.master_product_id = 4039359 THEN 4039359 WHEN sp.master_product_id = 127440 THEN 4039359 WHEN sp.master_product_id = 129463 THEN 4039359 WHEN sp.master_product_id = 9960259 THEN 4016585 WHEN sp.master_product_id = 4016585 THEN 4016585 WHEN sp.master_product_id = 4546323 THEN 4016585 WHEN sp.master_product_id = 149368 THEN 4016585 WHEN sp.master_product_id = 2663583 THEN 4016585 WHEN sp.master_product_id = 7561917 THEN 7561917 WHEN sp.master_product_id = 195947 THEN 7561917 WHEN sp.master_product_id = 1941919 THEN 7561917 WHEN sp.master_product_id = 1456452 THEN 7561917 WHEN sp.master_product_id = 157276 THEN 7561917 WHEN sp.master_product_id = 191901 THEN 7561917 WHEN sp.master_product_id = 157163 THEN 7561917 WHEN sp.master_product_id = 7513702 THEN 7513702 WHEN sp.master_product_id = 2902166 THEN 7513702 WHEN sp.master_product_id = 3482419 THEN 7513702 WHEN sp.master_product_id = 4029456 THEN 7529435 WHEN sp.master_product_id = 7529435 THEN 7529435 ELSE sp.master_product_id END limit 500
Bindings:
[7561917,7529435,7513702,7477797,7472471,7466366,7461021,7455068,7446739,7431628,6908951,6744655,6708345,6571261,4302537,4116124,4094723,4094721,4093867,4064767,4064694,4047733,4046320,4039527,4039525,4039359,4020207,4016585,4004803,3982444,3979153,3977494,154964,1909820,2927777,134045,1454922,165505,1458061,1909941,1930007,205836,112818,127440,129463,9960259,4546323,149368,2663583,195947,1941919,1456452,157276,191901,157163,2902166,3482419,4029456,0,223,1118,1181,1221,1290,14,38,261,226,292,431,454,458,492,493,567,663,672,683,687,4,16,32,73,118,212,231]
#9
⏱️ 18.71 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1618229,1619999,1615349,1614150,4562474,4557506,10559885,2036232,10559668,10563170,38871667,2032193,29414667,2305452,2304191,11243617,11251211,2310289,29776380,29875522,2360626,11437603,11418925,2356884,31390947,2556445,30308540,37902534,12155103,2557246,12159043,31754336,2557214,2556741,12160014,2556428,78598534,31746529,2556855,78610932,42185806,42186110,31760690,2559164,2562475,12166789,30315692,2562369,12166388,2562430,12167588,2562433,78510244,42059866,60123020,60090629,60089629,60101262,60118167,60101248,60101250,60114662,60117384,60106310,60101264,60107381,60109236,60109237,60112095,3626083,60106375]
#10
⏱️ 2.43 мс
select * from "stores" where "stores"."id" in (16, 73, 431, 454, 458, 492, 493, 567)
#11
⏱️ 1.97 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["givatayim"]
#12
⏱️ 2.41 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 2.13 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]