#1
⏱️ 179.12 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"haifa"]
#2
⏱️ 2078.68 мс
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",13,1111,707,202,716,734,721,102,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,8,49,52,57,61,62,67,72,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,15,28,701,74,89,137,211,233,319,331,true,13,1111,707,202,716,734,721,102,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,8,49,52,57,61,62,67,72,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,15,28,701,74,89,137,211,233,319,331,"produce"]
#3
⏱️ 1380.97 мс
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",13,1111,707,202,716,734,721,102,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,8,49,52,57,61,62,67,72,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,15,28,701,74,89,137,211,233,319,331,true,13,1111,707,202,716,734,721,102,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,8,49,52,57,61,62,67,72,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,15,28,701,74,89,137,211,233,319,331,"produce"]
#4
⏱️ 23.22 мс
select * from "canonical_products" where "canonical_products"."id" in (14, 16, 28, 31, 37, 53, 84, 102, 139, 163, 212)
#5
⏱️ 11.96 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[37,31,16,28,84,139,102,163,53,212,14]
#6
⏱️ 373.31 мс
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,7461021,7454739,7446739,7431628,6744655,6708345,6557578,5130389,4463398,4419810,4413845,4228681,4213727,4118978,4116124,4064767,4063255,4047733,4047728,4046344,4046320,4042828,4041802,1431276,8775708,8775709,8775781,1454922,133559,95625,165505,96457,154964,190924,3802561,8775707,8775710,8775711,622184,195156,115076,2676452,8775712,2669989,2609947,7471561,115658,111499,3619438,94956,96458,158027,1464692,112515,133472,154941,97843,2712622,190301,114703,115686,124682,true,13,1111,707,202,716,734,721,102,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,8,49,52,57,61,62,67,72,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,15,28,701,74,89,137,211,233,319,331]
#7
⏱️ 13.52 мс
select * from "stores" where "stores"."id" in (8, 9, 12, 13, 15, 28, 72, 74, 89, 102, 137, 309, 319, 323, 331, 366, 701, 734)
#8
⏱️ 71.7 мс
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 = 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 = 4041802 THEN 4041802 WHEN sp.master_product_id = 4463398 THEN 4463398 WHEN sp.master_product_id = 1454922 THEN 7461021 WHEN sp.master_product_id = 133559 THEN 4046344 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 = 96457 THEN 4046344 WHEN sp.master_product_id = 154964 THEN 4064767 WHEN sp.master_product_id = 190924 THEN 8506300 WHEN sp.master_product_id = 3802561 THEN 4041802 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 = 8775782 THEN 8775782 WHEN sp.master_product_id = 4213727 THEN 4213727 WHEN sp.master_product_id = 622184 THEN 8506300 WHEN sp.master_product_id = 195156 THEN 4213727 WHEN sp.master_product_id = 8506300 THEN 8506300 WHEN sp.master_product_id = 115076 THEN 4046344 WHEN sp.master_product_id = 2676452 THEN 4463398 WHEN sp.master_product_id = 8775712 THEN 8775713 WHEN sp.master_product_id = 2669989 THEN 4046344 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 = 3619438 THEN 8506300 WHEN sp.master_product_id = 4064767 THEN 4064767 WHEN sp.master_product_id = 94956 THEN 4041802 WHEN sp.master_product_id = 96458 THEN 7454739 WHEN sp.master_product_id = 4046344 THEN 4046344 WHEN sp.master_product_id = 158027 THEN 4213727 WHEN sp.master_product_id = 1464692 THEN 4046344 WHEN sp.master_product_id = 112515 THEN 4041802 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 = 190301 THEN 4041802 WHEN sp.master_product_id = 114703 THEN 8775713 WHEN sp.master_product_id = 115686 THEN 8775713 WHEN sp.master_product_id = 124682 THEN 4463398 ELSE sp.master_product_id END limit 500
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,8506300,7461021,7454739,7446739,7431628,6744655,6708345,6557578,5130389,4463398,4419810,4413845,4228681,4213727,4118978,4116124,4064767,4063255,4047733,4047728,4046344,4046320,4042828,4041802,1431276,8775708,8775709,8775781,1454922,133559,95625,165505,96457,154964,190924,3802561,8775707,8775710,8775711,622184,195156,115076,2676452,8775712,2669989,2609947,7471561,115658,111499,3619438,94956,96458,158027,1464692,112515,133472,154941,97843,2712622,190301,114703,115686,124682,0,13,1111,707,202,716,734,721,102,220,309,323,1140,1156,1207,1244,1275,583,1291,1292,657,1345,9,8,49,52,57,61,62,67,72,422,434,468,472,474,1356,558,658,671,1369,1388,366,12,15,28,701,74,89,137,211,233,319,331]
#9
⏱️ 83.62 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1581669,6306634,6306635,6304637,6297694,809660,809661,808831,1591307,1591308,1590511,6181629,6181631,6180106,6157045,6141347,1606316,6141348,1605581,6139044,1602865,5771033,5771034,5768300,4594778,839389,839390,4530105,838448,4651883,4290742,4290743,4285250,7537152,5767513,5767514,5762512,570985,570986,570192,584047,584048,583144,689344,689345,688495,1042350,1038002,1038003,1037042,714262,714263,713570,1075762,1071946,1071947,1071038,1174027,1169579,1169580,1168583,1946492,10458050,1948345,10463142,10455202,1946331,2081665,2074191,2071548,10639428,10638359,2081585,2472285,2471974,2470435,30119065,30109955,2472185,39753069,11777987,2485451,2483758,2484710,11904294,11899551,68383179,2485374,2485505,11947902,2492231,2492675,11961278,11952300,2492619,2495477,2495063,30182070,24808397,78409777,3579516,43031043,78405026,24807428,25061257,25062040,25064740,3406059,25065805,78857268,3405104,77931930,3403659,25059200,424862,395670,395671,394838,3784228,3785053,3787850,3321230,3788956,3788958,28450665,24284458,78786140,78789570,3318721,3779945,24990375,3786800,24306609,3316092,3949540,4005096,4024833,3835891,3828280,9560115,9560322,9560437,9560736,9570902,9581298,4066672,9613061]
#10
⏱️ 10.72 мс
select * from "stores" where "stores"."id" in (8, 9, 12, 13, 15, 28, 72, 74, 89, 102, 137, 211, 220, 309, 319, 323, 331, 366, 422, 434, 468, 472, 474, 558, 583, 701, 707, 734)
#11
⏱️ 16.97 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["haifa"]
#12
⏱️ 15.67 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 20.7 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]