#1
⏱️ 35.51 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"kfar-saba"]
#2
⏱️ 578.71 мс
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",740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392,true,740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392,"produce"]
#3
⏱️ 135.1 мс
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",740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392,true,740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392,"produce"]
#4
⏱️ 1.57 мс
select * from "canonical_products" where "canonical_products"."id" in (16, 28, 31, 37, 39, 44, 84, 139, 163, 194, 217)
#5
⏱️ 0.88 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[37,31,16,28,194,84,139,44,217,39,163]
#6
⏱️ 196.58 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,8506300,7529435,7516636,7466366,7461021,7455068,7454739,7446739,7441884,7431628,7428697,6908951,6744655,6708345,5130389,4977345,4415300,4324769,4228681,4226326,4213899,4213727,4116124,4094723,8775708,8775709,8775781,1454922,95625,165505,160965,190924,8775707,8775710,8775711,364245,622184,4029456,195156,8775712,162165,110740,2609947,7471561,115658,111499,155608,3619438,133515,96458,158027,133472,154941,97843,2712622,114703,115686,true,740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392]
#7
⏱️ 2.78 мс
select * from "stores" where "stores"."id" in (25, 141, 295, 302, 317, 329, 354, 368, 392, 740)
#8
⏱️ 22.63 мс
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 = 8775708 THEN 8775713 WHEN sp.master_product_id = 8775709 THEN 8775713 WHEN sp.master_product_id = 8775781 THEN 8775782 WHEN sp.master_product_id = 7428697 THEN 7428697 WHEN sp.master_product_id = 1454922 THEN 7461021 WHEN sp.master_product_id = 7454739 THEN 7454739 WHEN sp.master_product_id = 7461021 THEN 7461021 WHEN sp.master_product_id = 95625 THEN 8506300 WHEN sp.master_product_id = 165505 THEN 7461021 WHEN sp.master_product_id = 160965 THEN 7428697 WHEN sp.master_product_id = 190924 THEN 8506300 WHEN sp.master_product_id = 4324769 THEN 4324769 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 = 364245 THEN 4415300 WHEN sp.master_product_id = 8775782 THEN 8775782 WHEN sp.master_product_id = 4213727 THEN 4213727 WHEN sp.master_product_id = 4415300 THEN 4415300 WHEN sp.master_product_id = 622184 THEN 8506300 WHEN sp.master_product_id = 4029456 THEN 7529435 WHEN sp.master_product_id = 195156 THEN 4213727 WHEN sp.master_product_id = 8506300 THEN 8506300 WHEN sp.master_product_id = 8775712 THEN 8775713 WHEN sp.master_product_id = 162165 THEN 4324769 WHEN sp.master_product_id = 110740 THEN 4324769 WHEN sp.master_product_id = 2609947 THEN 8775713 WHEN sp.master_product_id = 7471561 THEN 8775528 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 = 7529435 THEN 7529435 WHEN sp.master_product_id = 155608 THEN 4415300 WHEN sp.master_product_id = 3619438 THEN 8506300 WHEN sp.master_product_id = 133515 THEN 4324769 WHEN sp.master_product_id = 96458 THEN 7454739 WHEN sp.master_product_id = 158027 THEN 4213727 WHEN sp.master_product_id = 133472 THEN 7454739 WHEN sp.master_product_id = 154941 THEN 8506300 WHEN sp.master_product_id = 97843 THEN 8506300 WHEN sp.master_product_id = 2712622 THEN 7454739 WHEN sp.master_product_id = 114703 THEN 8775713 WHEN sp.master_product_id = 115686 THEN 8775713 ELSE sp.master_product_id END limit 500
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,8506300,7529435,7516636,7466366,7461021,7455068,7454739,7446739,7441884,7431628,7428697,6908951,6744655,6708345,5130389,4977345,4415300,4324769,4228681,4226326,4213899,4213727,4116124,4094723,8775708,8775709,8775781,1454922,95625,165505,160965,190924,8775707,8775710,8775711,364245,622184,4029456,195156,8775712,162165,110740,2609947,7471561,115658,111499,155608,3619438,133515,96458,158027,133472,154941,97843,2712622,114703,115686,0,740,354,368,1124,1138,1226,1238,584,50,249,478,498,556,25,141,194,222,254,295,302,317,329,392]
#9
⏱️ 25.35 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1224210,1223257,5563770,5553866,5548352,662154,661450,5596788,1022935,1021249,1020210,4636355,1138750,1136970,1135893,1184978,1184143,1361982,1361130,2516371,2515203,30213963,2516823,12039026,2516818,47580059,33771588,2514719,2515185,2515104,31663759,2582913,2581389,18970990,50492148,30343806,12211098,2581404,2580918,12214793,12215456,78649657,30342749,56623374,59762977,3574127,59751397,24795223,24797574,3574904,24795829,59763039,59764876,3573049,3418534,24514934,3417943,3421781,24505317,77968206,3415051,78870063,4098842,9612170,4024839,3835897,3828286,9560121,9560328,9560443,9560742,9570908,9581304,4066678,9613067]
#10
⏱️ 1.96 мс
select * from "stores" where "stores"."id" in (25, 141, 295, 302, 317, 329, 354, 368, 392, 478, 498, 556, 584, 740)
#11
⏱️ 2.5 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["kfar-saba"]
#12
⏱️ 1.53 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 1.73 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]