#1
⏱️ 83.86 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"herzliya"]
#2
⏱️ 211.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","herbs_mushrooms",2,542,761,1141,1157,1194,1219,1223,714,626,647,1343,158,198,494,560,652,1380,358,383,true,2,542,761,1141,1157,1194,1219,1223,714,626,647,1343,158,198,494,560,652,1380,358,383,"produce"]
#3
⏱️ 214.58 мс
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",2,542,761,1141,1157,1194,1219,1223,714,626,647,1343,158,198,494,560,652,1380,358,383,true,2,542,761,1141,1157,1194,1219,1223,714,626,647,1343,158,198,494,560,652,1380,358,383,"produce"]
#4
⏱️ 11.54 мс
select * from "canonical_products" where "canonical_products"."id" in (5, 28, 49, 57, 87, 140, 180, 181, 217, 228, 257, 279, 308)
#5
⏱️ 9.36 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[28,308,5,181,228,140,87,257,279,49,180,57,217]
#6
⏱️ 94.89 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8506300,4991092,4989961,4987921,4987920,4987918,4987624,4987231,4986722,4986606,4986434,4985340,4984012,4983887,4983785,4983721,4983719,4983613,4681547,4678136,4658871,4658870,4658869,4658868,4526816,4526787,4492500,4463500,4415637,4415300,4405567,4226326,4983654,3619438,622184,190924,154941,95625,97843,157207,1456451,154874,160600,162815,96257,149434,2661944,4148882,162154,3253825,2261290,4041677,154967,162805,195121,207015,110668,207016,195120,110465,3855719,1980207,4055598,162816,160964,166942,4259731,3569061,112144,155798,364245,155608,195117,111088,109484,109821,207014,195119,207013,195118,4525248,true,2,542,761,1141,1157,1194,1219,1223,714,626,647,1343,158,198,494,560,652,1380,358,383]
#7
⏱️ 7.49 мс
select * from "stores" where "stores"."id" in (2, 358, 383, 542)
#8
⏱️ 64.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 = 3619438 THEN 8506300 WHEN sp.master_product_id = 8506300 THEN 8506300 WHEN sp.master_product_id = 622184 THEN 8506300 WHEN sp.master_product_id = 190924 THEN 8506300 WHEN sp.master_product_id = 154941 THEN 8506300 WHEN sp.master_product_id = 95625 THEN 8506300 WHEN sp.master_product_id = 97843 THEN 8506300 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 = 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 = 195121 THEN 4658870 WHEN sp.master_product_id = 4658870 THEN 4658870 WHEN sp.master_product_id = 207015 THEN 4658870 WHEN sp.master_product_id = 110668 THEN 4658870 WHEN sp.master_product_id = 4658871 THEN 4658871 WHEN sp.master_product_id = 207016 THEN 4658871 WHEN sp.master_product_id = 195120 THEN 4658871 WHEN sp.master_product_id = 110465 THEN 4658871 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 = 166942 THEN 4681547 WHEN sp.master_product_id = 4259731 THEN 4681547 WHEN sp.master_product_id = 3569061 THEN 4681547 WHEN sp.master_product_id = 112144 THEN 4681547 WHEN sp.master_product_id = 155798 THEN 4681547 WHEN sp.master_product_id = 4681547 THEN 4681547 WHEN sp.master_product_id = 364245 THEN 4415300 WHEN sp.master_product_id = 4415300 THEN 4415300 WHEN sp.master_product_id = 155608 THEN 4415300 WHEN sp.master_product_id = 4678136 THEN 4678136 WHEN sp.master_product_id = 195117 THEN 4678136 WHEN sp.master_product_id = 111088 THEN 4678136 WHEN sp.master_product_id = 109484 THEN 4678136 WHEN sp.master_product_id = 109821 THEN 4678136 WHEN sp.master_product_id = 207014 THEN 4658869 WHEN sp.master_product_id = 195119 THEN 4658869 WHEN sp.master_product_id = 4658869 THEN 4658869 WHEN sp.master_product_id = 4658868 THEN 4658868 WHEN sp.master_product_id = 207013 THEN 4658868 WHEN sp.master_product_id = 195118 THEN 4658868 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:
[8506300,4991092,4989961,4987921,4987920,4987918,4987624,4987231,4986722,4986606,4986434,4985340,4984012,4983887,4983785,4983721,4983719,4983613,4681547,4678136,4658871,4658870,4658869,4658868,4526816,4526787,4492500,4463500,4415637,4415300,4405567,4226326,4983654,3619438,622184,190924,154941,95625,97843,157207,1456451,154874,160600,162815,96257,149434,2661944,4148882,162154,3253825,2261290,4041677,154967,162805,195121,207015,110668,207016,195120,110465,3855719,1980207,4055598,162816,160964,166942,4259731,3569061,112144,155798,364245,155608,195117,111088,109484,109821,207014,195119,207013,195118,4525248,0,2,542,761,1141,1157,1194,1219,1223,714,626,647,1343,158,198,494,560,652,1380,358,383]
#9
⏱️ 17.88 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6389107,6391444,6387997,782180,781555,1290844,1292333,1290244,2565678,2565677,2565669,3768059,363108,368117,368115,3772369,363812,363096,3585946,3586148,3586147,3583353,2928364,2928404,2930997,2930365,2929245,2929244,2926891,2930389,3238207,3230768,2926890,3230899,3231001,3231126,3232454,3233548,3233720,3233836,3234345,3234738,3235032,3235034,3235035,3237075,3238244,2926037,487057,486463]
#10
⏱️ 15.25 мс
select * from "stores" where "stores"."id" in (2, 358, 383, 494, 542, 560, 626, 761)
#11
⏱️ 4.43 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["herzliya"]
#12
⏱️ 9.55 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 19.45 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]