#1
⏱️ 182.44 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"ashkelon"]
#2
⏱️ 1129.88 мс
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",737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,"produce"]
#3
⏱️ 1023.07 мс
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",737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,"produce"]
#4
⏱️ 10.65 мс
select * from "canonical_products" where "canonical_products"."id" in (9, 14, 16, 31, 37, 39, 71, 84, 163, 194, 217)
#5
⏱️ 8.47 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[37,31,16,194,71,84,217,39,163,9,14]
#6
⏱️ 212.1 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,7529435,7477797,7472471,7466366,7461021,7455068,7446739,7431628,6908951,6744655,6708345,5130389,4983751,4447166,4415300,4324769,4213727,4118966,4116124,4047728,4046320,4042828,4041802,4039527,1453310,1431276,8775708,8775709,8775781,1909820,1454922,2927777,165505,2984317,1465364,3802561,8775707,8775710,8775711,364245,4029456,195156,1453360,8775712,162165,110740,2609947,7471561,115658,111499,155608,133515,94956,112864,156666,134045,162808,158027,112515,160598,190301,114703,115686,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405]
#7
⏱️ 13.92 мс
select * from "stores" where "stores"."id" in (37, 122, 131, 169, 405, 737)
#8
⏱️ 50.02 мс
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 = 4118966 THEN 4118966 WHEN sp.master_product_id = 1453310 THEN 4118966 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 = 1909820 THEN 7477797 WHEN sp.master_product_id = 1454922 THEN 7461021 WHEN sp.master_product_id = 2927777 THEN 7477797 WHEN sp.master_product_id = 7461021 THEN 7461021 WHEN sp.master_product_id = 165505 THEN 7461021 WHEN sp.master_product_id = 2984317 THEN 4118966 WHEN sp.master_product_id = 4324769 THEN 4324769 WHEN sp.master_product_id = 1465364 THEN 4118966 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 = 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 = 4029456 THEN 7529435 WHEN sp.master_product_id = 195156 THEN 4213727 WHEN sp.master_product_id = 1453360 THEN 4118966 WHEN sp.master_product_id = 8775712 THEN 8775713 WHEN sp.master_product_id = 162165 THEN 4324769 WHEN sp.master_product_id = 7477797 THEN 7477797 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 = 133515 THEN 4324769 WHEN sp.master_product_id = 94956 THEN 4041802 WHEN sp.master_product_id = 112864 THEN 4118966 WHEN sp.master_product_id = 156666 THEN 4118966 WHEN sp.master_product_id = 134045 THEN 7477797 WHEN sp.master_product_id = 162808 THEN 4118966 WHEN sp.master_product_id = 158027 THEN 4213727 WHEN sp.master_product_id = 112515 THEN 4041802 WHEN sp.master_product_id = 160598 THEN 4118966 WHEN sp.master_product_id = 190301 THEN 4041802 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,7529435,7477797,7472471,7466366,7461021,7455068,7446739,7431628,6908951,6744655,6708345,5130389,4983751,4447166,4415300,4324769,4213727,4118966,4116124,4047728,4046320,4042828,4041802,4039527,1453310,1431276,8775708,8775709,8775781,1909820,1454922,2927777,165505,2984317,1465364,3802561,8775707,8775710,8775711,364245,4029456,195156,1453360,8775712,162165,110740,2609947,7471561,115658,111499,155608,133515,94956,112864,156666,134045,162808,158027,112515,160598,190301,114703,115686,0,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405]
#9
⏱️ 12.57 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[457685,7815086,6073813,6059022,6531300,14644137,5902035,11762289,2465779,2464287,2463695,11752707,11763323,33637468,68311853,11750915,47661306,2542224,12120204,2542246,31723080,31716081,31717923,2544099,12120381,2542260,2542226,31710634,33830596,2541863,56579515,3811729,3813679,14445903,3817111,3818152,55164498,3348828,3346772,3350119,3812352,25017957,3353392,3811621,3949543,3957326,4098839,9612167,4024836,9560118,9560325,9560440,9560739,9570905,9581301,4066675,9613064,512657]
#10
⏱️ 11.52 мс
select * from "stores" where "stores"."id" in (37, 122, 131, 169, 405, 467, 489, 544, 737, 765)
#11
⏱️ 9.54 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["ashkelon"]
#12
⏱️ 11.6 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 9.82 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]