#1
⏱️ 191.49 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"givatayim"]
#2
⏱️ 2099.82 мс
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",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
⏱️ 1685.64 мс
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",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
⏱️ 8.97 мс
select * from "canonical_products" where "canonical_products"."id" in (61, 71, 84, 99, 159, 171, 172, 181, 193, 194)
#5
⏱️ 11.59 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[159,194,193,172,99,71,61,84,181,171]
#6
⏱️ 210.91 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[7561917,7529435,7529293,7514223,7513702,7508207,7495742,7493492,7493489,7482266,7477797,7472471,7471575,7466366,7461021,7455068,7452710,7446739,7439517,7431628,7182537,6908951,6744655,6708345,6571261,4681547,4302537,4116124,4110824,4094723,4094721,4093867,2713394,3084195,1909820,2927777,134045,1454922,165505,2604819,112364,195947,1941919,1456452,157276,191901,157163,155793,2045916,157118,157278,2902166,3482419,155798,4259731,3569061,166942,112144,112362,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
⏱️ 20.82 мс
select * from "stores" where "stores"."id" in (14, 73, 118)
#8
⏱️ 65.2 мс
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 = 2713394 THEN 7471575 WHEN sp.master_product_id = 7471575 THEN 7471575 WHEN sp.master_product_id = 3084195 THEN 7471575 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 = 7493492 THEN 7493492 WHEN sp.master_product_id = 2604819 THEN 7493492 WHEN sp.master_product_id = 112364 THEN 7493492 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 = 155793 THEN 4110824 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 = 7513702 THEN 7513702 WHEN sp.master_product_id = 2902166 THEN 7513702 WHEN sp.master_product_id = 3482419 THEN 7513702 WHEN sp.master_product_id = 155798 THEN 4681547 WHEN sp.master_product_id = 4259731 THEN 4681547 WHEN sp.master_product_id = 3569061 THEN 4681547 WHEN sp.master_product_id = 166942 THEN 4681547 WHEN sp.master_product_id = 112144 THEN 4681547 WHEN sp.master_product_id = 4681547 THEN 4681547 WHEN sp.master_product_id = 7529293 THEN 7529293 WHEN sp.master_product_id = 112362 THEN 7529293 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,7529293,7514223,7513702,7508207,7495742,7493492,7493489,7482266,7477797,7472471,7471575,7466366,7461021,7455068,7452710,7446739,7439517,7431628,7182537,6908951,6744655,6708345,6571261,4681547,4302537,4116124,4110824,4094723,4094721,4093867,2713394,3084195,1909820,2927777,134045,1454922,165505,2604819,112364,195947,1941919,1456452,157276,191901,157163,155793,2045916,157118,157278,2902166,3482419,155798,4259731,3569061,166942,112144,112362,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
⏱️ 20.89 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1548872,70732279,1615413,1619999,1615349,1617030,1617028,1614150,4562474,4565212,4565210,4557506,6465138,10559668,10563170,38871667,77652836,2032193,33179264,2041841,2029774,29414667,11243617,11251211,11263115,2303474,2310289,31345234,11277694,11277691,29776380,11437603,11418925,11408103,2356884,29876031,68122290,11435033,31390947,56592568,30308540,37902534,12155103,2557246,2558819,12159043,31750349,31754336,2557214,2556741,12158108,12160014,2556428,56592536,56592539,30310745,2556945,78598534,31746529,2556855,2562474,42185806,42186110,31760690,2559164,2560480,2562475,2558877,12166789,30315692,2562369,31760701,12166388,31757916,56601214,2562430,2562961,78605237,12167588,2562433,60107381,60109236,60109237,3624594,60112095,3626083,3627784,60106375]
#10
⏱️ 8.5 мс
select * from "stores" where "stores"."id" in (4, 14, 16, 73, 118, 431, 454, 458, 492, 493, 567)
#11
⏱️ 11.69 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["givatayim"]
#12
⏱️ 11.2 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 13.77 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]