#1
⏱️ 166.9 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"haifa"]
#2
⏱️ 611.05 мс
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",1111,13,701,707,716,734,721,211,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,319,331,8,15,28,49,52,57,61,62,67,72,89,102,137,202,233,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,74,true,1111,13,701,707,716,734,721,211,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,319,331,8,15,28,49,52,57,61,62,67,72,89,102,137,202,233,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,74,"produce"]
#3
⏱️ 270.77 мс
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",1111,13,701,707,716,734,721,211,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,319,331,8,15,28,49,52,57,61,62,67,72,89,102,137,202,233,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,74,true,1111,13,701,707,716,734,721,211,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,319,331,8,15,28,49,52,57,61,62,67,72,89,102,137,202,233,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,74,"produce"]
#4
⏱️ 20.22 мс
select * from "canonical_products" where "canonical_products"."id" in (14, 16, 31, 37, 212)
#5
⏱️ 3.55 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?)
Bindings:
[37,31,16,212,14]
#6
⏱️ 150.09 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775782,8775713,8775546,8775528,7446739,7431628,6557578,5130389,4987518,4413845,4097824,4083914,4047733,4047728,4046344,4042828,4041802,4038973,4025480,4013398,4004426,3997644,3996093,3991036,3988472,3987208,3986599,3986018,3985219,3982444,3980340,3979153,1431276,3802561,190301,94956,112515,7471561,8775708,8775709,8775712,8775707,8775710,8775711,2609947,115658,111499,114703,115686,8775781,133559,115076,96457,2669989,1464692,true,1111,13,701,707,716,734,721,211,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,319,331,8,15,28,49,52,57,61,62,67,72,89,102,137,202,233,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,74]
#7
⏱️ 8.51 мс
select * from "stores" where "stores"."id" in (8, 9, 12, 13, 15, 28, 102, 137, 309, 319, 323, 331, 366, 701, 734)
#8
⏱️ 50.47 мс
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 = 1431276 THEN 4041802 WHEN sp.master_product_id = 3802561 THEN 4041802 WHEN sp.master_product_id = 4041802 THEN 4041802 WHEN sp.master_product_id = 190301 THEN 4041802 WHEN sp.master_product_id = 94956 THEN 4041802 WHEN sp.master_product_id = 112515 THEN 4041802 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 = 8775781 THEN 8775782 WHEN sp.master_product_id = 8775782 THEN 8775782 WHEN sp.master_product_id = 133559 THEN 4046344 WHEN sp.master_product_id = 115076 THEN 4046344 WHEN sp.master_product_id = 4046344 THEN 4046344 WHEN sp.master_product_id = 96457 THEN 4046344 WHEN sp.master_product_id = 2669989 THEN 4046344 WHEN sp.master_product_id = 1464692 THEN 4046344 ELSE sp.master_product_id END limit 500
Bindings:
[8775782,8775713,8775546,8775528,7446739,7431628,6557578,5130389,4987518,4413845,4097824,4083914,4047733,4047728,4046344,4042828,4041802,4038973,4025480,4013398,4004426,3997644,3996093,3991036,3988472,3987208,3986599,3986018,3985219,3982444,3980340,3979153,1431276,3802561,190301,94956,112515,7471561,8775708,8775709,8775712,8775707,8775710,8775711,2609947,115658,111499,114703,115686,8775781,133559,115076,96457,2669989,1464692,0,1111,13,701,707,716,734,721,211,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,319,331,8,15,28,49,52,57,61,62,67,72,89,102,137,202,233,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,74]
#9
⏱️ 6.61 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1581669,6306634,6297694,809660,1591307,6181629,6157045,6141347,1606316,1602865,5771033,839389,4290742,7537152,5767513,570985,584047,689344,1042350,1038002,714262,1075762,1071946,1174027,1169579,1946492,2081665,2472285,2485451,2492619,2495477,3579361,3579516,3405781,3406059,3407754,424862,395670,3788624,3324093,3327220,3328152,3310592,3311200,3312463,7372708,3320064,3321611,3328365,3792478,3787731,3781853,3784228,3785053,3321230,3788956,3788958,3788329,3779945,3949540,4005096,4024833,4066672]
#10
⏱️ 5.92 мс
select * from "stores" where "stores"."id" in (8, 9, 12, 13, 15, 28, 74, 102, 137, 211, 220, 309, 319, 323, 331, 366, 422, 434, 468, 472, 474, 558, 583, 701, 707, 734)
#11
⏱️ 7.58 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["haifa"]
#12
⏱️ 6 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 9.51 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]