#1
⏱️ 120.58 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"jerusalem"]
#2
⏱️ 598.6 мс
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",1110,700,727,728,745,746,759,775,171,170,278,259,286,320,332,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,88,87,85,106,109,114,143,166,208,268,274,279,281,315,306,429,436,437,461,485,486,535,1371,1385,1386,1409,149,6,83,true,1110,700,727,728,745,746,759,775,171,170,278,259,286,320,332,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,88,87,85,106,109,114,143,166,208,268,274,279,281,315,306,429,436,437,461,485,486,535,1371,1385,1386,1409,149,6,83,"produce"]
#3
⏱️ 347.59 мс
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",1110,700,727,728,745,746,759,775,171,170,278,259,286,320,332,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,88,87,85,106,109,114,143,166,208,268,274,279,281,315,306,429,436,437,461,485,486,535,1371,1385,1386,1409,149,6,83,true,1110,700,727,728,745,746,759,775,171,170,278,259,286,320,332,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,88,87,85,106,109,114,143,166,208,268,274,279,281,315,306,429,436,437,461,485,486,535,1371,1385,1386,1409,149,6,83,"produce"]
#4
⏱️ 18.27 мс
select * from "canonical_products" where "canonical_products"."id" in (16, 31, 34, 37, 123, 149, 170, 176, 245, 280, 359)
#5
⏱️ 10.51 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[37,31,16,149,359,245,34,176,170,280,123]
#6
⏱️ 377.1 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775782,8775713,8775546,8775528,7499337,7489530,7455068,7442349,7431628,7065236,6745776,6744655,6730411,6708345,6571261,6557578,5130389,4987518,3915123,3876067,3816664,3795026,3385632,3253804,3234156,3225948,3068182,3067885,3052772,3023008,3000475,3000385,7471561,8775708,8775709,8775712,8775707,8775710,8775711,2609947,115658,111499,114703,115686,95635,150763,109102,1993337,133482,199256,8775781,1453314,2058963,199437,1907938,98240,3719257,129450,750862,190887,109029,150733,133502,127014,1431157,95809,true,1110,700,727,728,745,746,759,775,171,170,278,259,286,320,332,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,88,87,85,106,109,114,143,166,208,268,274,279,281,315,306,429,436,437,461,485,486,535,1371,1385,1386,1409,149,6,83]
#7
⏱️ 10.6 мс
select * from "stores" where "stores"."id" in (6, 69, 83, 85, 87, 88, 106, 109, 114, 143, 149, 170, 171, 274, 278, 279, 281, 286, 306, 315, 320, 332, 535, 700, 727, 728, 746)
#8
⏱️ 510.16 мс
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 = 8775528 THEN 8775528 WHEN sp.master_product_id = 7471561 THEN 8775528 WHEN sp.master_product_id = 8775708 THEN 8775713 WHEN sp.master_product_id = 8775709 THEN 8775713 WHEN sp.master_product_id = 8775712 THEN 8775713 WHEN sp.master_product_id = 8775707 THEN 8775713 WHEN sp.master_product_id = 8775710 THEN 8775713 WHEN sp.master_product_id = 8775711 THEN 8775713 WHEN sp.master_product_id = 2609947 THEN 8775713 WHEN sp.master_product_id = 115658 THEN 8775713 WHEN sp.master_product_id = 8775713 THEN 8775713 WHEN sp.master_product_id = 111499 THEN 8775713 WHEN sp.master_product_id = 114703 THEN 8775713 WHEN sp.master_product_id = 115686 THEN 8775713 WHEN sp.master_product_id = 3225948 THEN 3225948 WHEN sp.master_product_id = 95635 THEN 3225948 WHEN sp.master_product_id = 150763 THEN 3225948 WHEN sp.master_product_id = 109102 THEN 3225948 WHEN sp.master_product_id = 1993337 THEN 3225948 WHEN sp.master_product_id = 133482 THEN 3225948 WHEN sp.master_product_id = 199256 THEN 3225948 WHEN sp.master_product_id = 8775781 THEN 8775782 WHEN sp.master_product_id = 8775782 THEN 8775782 WHEN sp.master_product_id = 1453314 THEN 3000385 WHEN sp.master_product_id = 3000385 THEN 3000385 WHEN sp.master_product_id = 2058963 THEN 3000385 WHEN sp.master_product_id = 199437 THEN 3000385 WHEN sp.master_product_id = 1907938 THEN 3000385 WHEN sp.master_product_id = 98240 THEN 3000385 WHEN sp.master_product_id = 3719257 THEN 3876067 WHEN sp.master_product_id = 3876067 THEN 3876067 WHEN sp.master_product_id = 129450 THEN 3876067 WHEN sp.master_product_id = 3067885 THEN 3067885 WHEN sp.master_product_id = 750862 THEN 3067885 WHEN sp.master_product_id = 190887 THEN 3067885 WHEN sp.master_product_id = 109029 THEN 3067885 WHEN sp.master_product_id = 150733 THEN 3067885 WHEN sp.master_product_id = 3068182 THEN 3068182 WHEN sp.master_product_id = 133502 THEN 3068182 WHEN sp.master_product_id = 3234156 THEN 3234156 WHEN sp.master_product_id = 127014 THEN 3234156 WHEN sp.master_product_id = 3052772 THEN 3052772 WHEN sp.master_product_id = 1431157 THEN 3052772 WHEN sp.master_product_id = 3795026 THEN 3795026 WHEN sp.master_product_id = 95809 THEN 3795026 ELSE sp.master_product_id END limit 500
Bindings:
[8775782,8775713,8775546,8775528,7499337,7489530,7455068,7442349,7431628,7065236,6745776,6744655,6730411,6708345,6571261,6557578,5130389,4987518,3915123,3876067,3816664,3795026,3385632,3253804,3234156,3225948,3068182,3067885,3052772,3023008,3000475,3000385,7471561,8775708,8775709,8775712,8775707,8775710,8775711,2609947,115658,111499,114703,115686,95635,150763,109102,1993337,133482,199256,8775781,1453314,2058963,199437,1907938,98240,3719257,129450,750862,190887,109029,150733,133502,127014,1431157,95809,0,1110,700,727,728,745,746,759,775,171,170,278,259,286,320,332,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,88,87,85,106,109,114,143,166,208,268,274,279,281,315,306,429,436,437,461,485,486,535,1371,1385,1386,1409,149,6,83]
#9
⏱️ 114.83 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1565359,1562166,1562359,4123103,4786893,4784790,4737221,4736919,4692661,4689578,4671720,4669104,6500394,6543864,5481764,5464962,5466839,4995791,4973729,4973927,558345,555344,555538,4995357,4953074,4899584,4894326,4910898,4888507,4891456,634354,632314,632474,5410191,5407983,5717070,5714310,5683631,5681078,5616046,5613484,658014,655937,656095,5530150,5532311,4962053,4954425,4957045,697328,694966,720882,718873,719017,2013098,2011496,2011480,2004175,2012879,2012099,2000966,2107607,2100263,2101124,2100724,2102552,2102471,2102412,2120805,2120789,2114048,2114743,2114209,2113974,2394408,2394392,2403440,2405098,2395961,2394590,1850308,1850398,1855853,1855837,1851676,1849199,1866261,1869436,1869417,1861649,2537479,2539021,2537420,2537406,2537501,2536633,2539412,2537858,2538268,143138,143187,9603714,147946,9560336,9560750,144754,9613075,246881,244558,244729,3872520,3874025,9440782,4024826,9440278,9440356,4066665,9440882,3872521,3874026,9603694,4024827,9560316,9560730,4066666,9613055,1666661,1666643,1657594,6716911,1660981,1673005,1672988,1678000,1668902,1678619,6727497,6726755,6726846,6727160,6726851,477738,476105,476246]
#10
⏱️ 17.12 мс
select * from "stores" where "stores"."id" in (6, 69, 83, 85, 87, 88, 106, 109, 143, 149, 170, 171, 259, 274, 278, 279, 281, 286, 306, 315, 320, 332, 429, 436, 437, 461, 482, 483, 486, 535, 700, 727, 728, 745, 746, 759)
#11
⏱️ 8.51 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["jerusalem"]
#12
⏱️ 13.19 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 6.96 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]