#1
⏱️ 169.89 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"haifa"]
#2
⏱️ 1636.82 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_slug" = ? and "master_products"."id" in ((select "master_product_id" from "store_prices" where "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) union (select "master_product_id" from "deals" where "is_active" = ? and "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",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
⏱️ 1534.92 мс
select * from "master_products" where "barcode" is not null and "category_slug" = ? and "master_products"."id" in ((select "master_product_id" from "store_prices" where "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) union (select "master_product_id" from "deals" where "is_active" = ? and "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",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
⏱️ 13.53 мс
select * from "canonical_products" where "canonical_products"."id" in (3, 16, 31, 37, 57, 102, 144, 199, 241)
#5
⏱️ 12.51 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[3,37,31,16,241,102,144,57,199]
#6
⏱️ 104.81 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775869,8775782,8775713,8775651,8775580,8775546,8775533,8775532,8775528,8775519,8775509,7446739,7443254,7431628,6557578,6533189,5130723,5130389,5127697,4988681,4987518,4463500,4463398,4424403,4415637,4413845,4395765,4158159,4097824,4085256,4085054,4083914,8775857,8775862,8775826,8775829,8775830,8775837,8775838,8775841,8775842,8775845,8775843,8775844,8775847,8775846,8775848,8775850,8775851,8775859,8775861,8775867,8775868,2645047,7696015,8775839,8775856,8775858,8775860,8775863,8775864,199939,4869230,4619338,8775832,8775833,8775836,8775865,8775825,8775828,4533490,189745,8775840,8775849,8775853,8775855,8775866,2642425,2671007,8775827,8775831,8775834,8775835,8775852,8775854,190787,7471561,8775708,8775709,8775712,8775707,8775710,8775711,2609947,115658,111499,114703,115686,8775781,4148882,162154,3253825,2261290,4041677,154967,162805,124682,2676452,192306,192305,1453237,2928563,196438,2603553,179969,166089,192304,109336,4019922,1907930,150734,133480,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
⏱️ 14.81 мс
select * from "stores" where "stores"."id" in (72, 74, 89, 734)
#8
⏱️ 130.13 мс
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 = 8775857 THEN 8775869 WHEN sp.master_product_id = 8775862 THEN 8775869 WHEN sp.master_product_id = 8775826 THEN 8775869 WHEN sp.master_product_id = 8775829 THEN 8775869 WHEN sp.master_product_id = 8775830 THEN 8775869 WHEN sp.master_product_id = 8775837 THEN 8775869 WHEN sp.master_product_id = 8775838 THEN 8775869 WHEN sp.master_product_id = 8775841 THEN 8775869 WHEN sp.master_product_id = 8775842 THEN 8775869 WHEN sp.master_product_id = 8775845 THEN 8775869 WHEN sp.master_product_id = 8775843 THEN 8775869 WHEN sp.master_product_id = 8775844 THEN 8775869 WHEN sp.master_product_id = 8775847 THEN 8775869 WHEN sp.master_product_id = 8775846 THEN 8775869 WHEN sp.master_product_id = 8775848 THEN 8775869 WHEN sp.master_product_id = 8775850 THEN 8775869 WHEN sp.master_product_id = 8775851 THEN 8775869 WHEN sp.master_product_id = 8775859 THEN 8775869 WHEN sp.master_product_id = 8775861 THEN 8775869 WHEN sp.master_product_id = 8775867 THEN 8775869 WHEN sp.master_product_id = 8775868 THEN 8775869 WHEN sp.master_product_id = 2645047 THEN 8775869 WHEN sp.master_product_id = 7696015 THEN 8775869 WHEN sp.master_product_id = 8775839 THEN 8775869 WHEN sp.master_product_id = 8775856 THEN 8775869 WHEN sp.master_product_id = 8775858 THEN 8775869 WHEN sp.master_product_id = 8775860 THEN 8775869 WHEN sp.master_product_id = 8775863 THEN 8775869 WHEN sp.master_product_id = 8775864 THEN 8775869 WHEN sp.master_product_id = 199939 THEN 8775869 WHEN sp.master_product_id = 4869230 THEN 8775869 WHEN sp.master_product_id = 4619338 THEN 8775869 WHEN sp.master_product_id = 8775832 THEN 8775869 WHEN sp.master_product_id = 8775833 THEN 8775869 WHEN sp.master_product_id = 8775836 THEN 8775869 WHEN sp.master_product_id = 8775865 THEN 8775869 WHEN sp.master_product_id = 8775825 THEN 8775869 WHEN sp.master_product_id = 8775828 THEN 8775869 WHEN sp.master_product_id = 4533490 THEN 8775869 WHEN sp.master_product_id = 189745 THEN 8775869 WHEN sp.master_product_id = 8775840 THEN 8775869 WHEN sp.master_product_id = 8775849 THEN 8775869 WHEN sp.master_product_id = 8775853 THEN 8775869 WHEN sp.master_product_id = 8775855 THEN 8775869 WHEN sp.master_product_id = 8775866 THEN 8775869 WHEN sp.master_product_id = 2642425 THEN 8775869 WHEN sp.master_product_id = 2671007 THEN 8775869 WHEN sp.master_product_id = 8775827 THEN 8775869 WHEN sp.master_product_id = 8775831 THEN 8775869 WHEN sp.master_product_id = 8775834 THEN 8775869 WHEN sp.master_product_id = 8775835 THEN 8775869 WHEN sp.master_product_id = 8775852 THEN 8775869 WHEN sp.master_product_id = 8775854 THEN 8775869 WHEN sp.master_product_id = 8775869 THEN 8775869 WHEN sp.master_product_id = 190787 THEN 8775869 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 = 4148882 THEN 4415637 WHEN sp.master_product_id = 162154 THEN 4415637 WHEN sp.master_product_id = 3253825 THEN 4415637 WHEN sp.master_product_id = 2261290 THEN 4415637 WHEN sp.master_product_id = 4041677 THEN 4415637 WHEN sp.master_product_id = 4415637 THEN 4415637 WHEN sp.master_product_id = 154967 THEN 4415637 WHEN sp.master_product_id = 162805 THEN 4415637 WHEN sp.master_product_id = 4463398 THEN 4463398 WHEN sp.master_product_id = 124682 THEN 4463398 WHEN sp.master_product_id = 2676452 THEN 4463398 WHEN sp.master_product_id = 192306 THEN 4424403 WHEN sp.master_product_id = 192305 THEN 4424403 WHEN sp.master_product_id = 1453237 THEN 4424403 WHEN sp.master_product_id = 2928563 THEN 4424403 WHEN sp.master_product_id = 196438 THEN 4424403 WHEN sp.master_product_id = 4424403 THEN 4424403 WHEN sp.master_product_id = 2603553 THEN 4424403 WHEN sp.master_product_id = 179969 THEN 4424403 WHEN sp.master_product_id = 166089 THEN 4424403 WHEN sp.master_product_id = 192304 THEN 4424403 WHEN sp.master_product_id = 109336 THEN 4424403 WHEN sp.master_product_id = 4085256 THEN 4085256 WHEN sp.master_product_id = 4019922 THEN 4085256 WHEN sp.master_product_id = 5130723 THEN 5130723 WHEN sp.master_product_id = 1907930 THEN 5130723 WHEN sp.master_product_id = 150734 THEN 5130723 WHEN sp.master_product_id = 133480 THEN 5130723 ELSE sp.master_product_id END limit 500
Bindings:
[8775869,8775782,8775713,8775651,8775580,8775546,8775533,8775532,8775528,8775519,8775509,7446739,7443254,7431628,6557578,6533189,5130723,5130389,5127697,4988681,4987518,4463500,4463398,4424403,4415637,4413845,4395765,4158159,4097824,4085256,4085054,4083914,8775857,8775862,8775826,8775829,8775830,8775837,8775838,8775841,8775842,8775845,8775843,8775844,8775847,8775846,8775848,8775850,8775851,8775859,8775861,8775867,8775868,2645047,7696015,8775839,8775856,8775858,8775860,8775863,8775864,199939,4869230,4619338,8775832,8775833,8775836,8775865,8775825,8775828,4533490,189745,8775840,8775849,8775853,8775855,8775866,2642425,2671007,8775827,8775831,8775834,8775835,8775852,8775854,190787,7471561,8775708,8775709,8775712,8775707,8775710,8775711,2609947,115658,111499,114703,115686,8775781,4148882,162154,3253825,2261290,4041677,154967,162805,124682,2676452,192306,192305,1453237,2928563,196438,2603553,179969,166089,192304,109336,4019922,1907930,150734,133480,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
⏱️ 10.16 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1581927,1603893,1606316,1602865,4591192,4524430,4651059,1948345,1946347,2071548,2081592,2470435,2484710,2485383,2492675,2495070,2492619,2492314,2495477,3577838,3579624,3580709,3577273,3407754,3408890,3409094,3406291,3408099,3788329,3794422,3778996,3779945,3321716,3325052,3786800,3786903,3311802,3880267,4030853,4024618,4024833,4024919,4066672,4028660]
#10
⏱️ 4.34 мс
select * from "stores" where "stores"."id" in (8, 15, 72, 74, 89, 422, 434, 468, 472, 474, 558, 583, 707, 734)
#11
⏱️ 21.73 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["haifa"]
#12
⏱️ 6.4 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 22.39 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]