#1
⏱️ 149.12 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"rishon-le-zion"]
#2
⏱️ 223.31 мс
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","herbs_mushrooms",3,731,749,769,321,343,1142,1160,1230,1232,1261,586,1280,600,617,1305,1312,1321,299,399,1349,39,92,116,129,126,150,175,196,238,365,427,457,508,509,1352,547,578,685,690,691,1384,22,true,3,731,749,769,321,343,1142,1160,1230,1232,1261,586,1280,600,617,1305,1312,1321,299,399,1349,39,92,116,129,126,150,175,196,238,365,427,457,508,509,1352,547,578,685,690,691,1384,22,"produce"]
#3
⏱️ 198.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","herbs_mushrooms",3,731,749,769,321,343,1142,1160,1230,1232,1261,586,1280,600,617,1305,1312,1321,299,399,1349,39,92,116,129,126,150,175,196,238,365,427,457,508,509,1352,547,578,685,690,691,1384,22,true,3,731,749,769,321,343,1142,1160,1230,1232,1261,586,1280,600,617,1305,1312,1321,299,399,1349,39,92,116,129,126,150,175,196,238,365,427,457,508,509,1352,547,578,685,690,691,1384,22,"produce"]
#4
⏱️ 12.72 мс
select * from "canonical_products" where "canonical_products"."id" in (5, 29, 49, 162, 180, 286, 308)
#5
⏱️ 6.15 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?)
Bindings:
[308,5,29,286,162,49,180]
#6
⏱️ 123.09 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,4991092,4989961,4987921,4987920,4987918,4987624,4987231,4986722,4986606,4986434,4985340,4984012,4983887,4983785,4983721,4983719,4983613,4777564,4576468,4546301,4546295,4546279,4546265,4533498,4526816,4526787,4983654,4536369,157207,1456451,154874,160600,162815,96257,149434,2661944,2666480,3855719,1980207,4055598,162816,160964,149430,4525248,true,3,731,749,769,321,343,1142,1160,1230,1232,1261,586,1280,600,617,1305,1312,1321,299,399,1349,39,92,116,129,126,150,175,196,238,365,427,457,508,509,1352,547,578,685,690,691,1384,22]
#7
⏱️ 12.81 мс
select * from "stores" where "stores"."id" in (3, 22, 92, 116, 126, 129, 150, 299, 321, 343, 365, 399, 731)
#8
⏱️ 39.96 мс
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 = 4983654 THEN 4983719 WHEN sp.master_product_id = 4983719 THEN 4983719 WHEN sp.master_product_id = 4777564 THEN 4777564 WHEN sp.master_product_id = 4536369 THEN 4777564 WHEN sp.master_product_id = 157207 THEN 4526816 WHEN sp.master_product_id = 4526816 THEN 4526816 WHEN sp.master_product_id = 1456451 THEN 4526816 WHEN sp.master_product_id = 154874 THEN 4526816 WHEN sp.master_product_id = 160600 THEN 4526816 WHEN sp.master_product_id = 162815 THEN 4526816 WHEN sp.master_product_id = 96257 THEN 4526816 WHEN sp.master_product_id = 149434 THEN 4526816 WHEN sp.master_product_id = 2661944 THEN 4526816 WHEN sp.master_product_id = 4546295 THEN 4546295 WHEN sp.master_product_id = 2666480 THEN 4546295 WHEN sp.master_product_id = 3855719 THEN 4526787 WHEN sp.master_product_id = 1980207 THEN 4526787 WHEN sp.master_product_id = 4055598 THEN 4526787 WHEN sp.master_product_id = 162816 THEN 4526787 WHEN sp.master_product_id = 160964 THEN 4526787 WHEN sp.master_product_id = 4526787 THEN 4526787 WHEN sp.master_product_id = 4546301 THEN 4546301 WHEN sp.master_product_id = 149430 THEN 4546301 WHEN sp.master_product_id = 4983721 THEN 4983721 WHEN sp.master_product_id = 4525248 THEN 4983721 ELSE sp.master_product_id END limit 500
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,4991092,4989961,4987921,4987920,4987918,4987624,4987231,4986722,4986606,4986434,4985340,4984012,4983887,4983785,4983721,4983719,4983613,4777564,4576468,4546301,4546295,4546279,4546265,4533498,4526816,4526787,4983654,4536369,157207,1456451,154874,160600,162815,96257,149434,2661944,2666480,3855719,1980207,4055598,162816,160964,149430,4525248,0,3,731,749,769,321,343,1142,1160,1230,1232,1261,586,1280,600,617,1305,1312,1321,299,399,1349,39,92,116,129,126,150,175,196,238,365,427,457,508,509,1352,547,578,685,690,691,1384,22]
#9
⏱️ 11 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6376050,5934898,4821475,6510988,6226101,6156895,4933602,990143,701740,741004,6102202,1415146,3490106,3487462,3698266,3698194,3456541,3454369,7825547,7825590,2844293,2845614,2845628,2845644,2845650,2845424,3178094,3170655,2835969,3170786,3170888,3171013,3172341,3173435,3173607,3173723,3174232,3174625,3174919,3174921,3174922,3176962,3178131,2908150,2912563,2913610,2903975,3215741,3215814,2904637,3215880,3215982,3216107,3217435,3218529,3218701,3218817,3219326,3219719,3220013,3220015,3220016,3222056,3223173,1720825,1724496,2750649,2747228,3110545,3110586,3110653,3110717,3110819,3110944,3112272,3113366,3113538,3113654,3114163,3114556,3114850,3114852,3114853,3116893,3118024]
#10
⏱️ 6.83 мс
select * from "stores" where "stores"."id" in (3, 22, 92, 116, 126, 129, 150, 299, 321, 343, 365, 399, 547, 578, 586, 600, 617, 749, 769)
#11
⏱️ 16.45 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["rishon-le-zion"]
#12
⏱️ 9.25 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 19.62 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]