#1
⏱️ 150.83 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"netanya"]
#2
⏱️ 611.23 мс
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",1113,708,739,753,773,236,96,112,1326,1173,1224,1311,1315,407,59,64,428,438,451,476,499,500,1390,554,619,664,1395,36,105,95,144,205,219,229,256,267,325,true,1113,708,739,753,773,236,96,112,1326,1173,1224,1311,1315,407,59,64,428,438,451,476,499,500,1390,554,619,664,1395,36,105,95,144,205,219,229,256,267,325,"produce"]
#3
⏱️ 373.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",1113,708,739,753,773,236,96,112,1326,1173,1224,1311,1315,407,59,64,428,438,451,476,499,500,1390,554,619,664,1395,36,105,95,144,205,219,229,256,267,325,true,1113,708,739,753,773,236,96,112,1326,1173,1224,1311,1315,407,59,64,428,438,451,476,499,500,1390,554,619,664,1395,36,105,95,144,205,219,229,256,267,325,"produce"]
#4
⏱️ 19.86 мс
select * from "canonical_products" where "canonical_products"."id" in (49, 162, 180, 181, 193, 276, 313, 326)
#5
⏱️ 12.37 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[193,181,276,162,313,49,180,326]
#6
⏱️ 275.55 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775532,8775509,7529293,7522489,7514223,7493489,7429691,7182537,4991092,4987921,4987920,4987918,4987624,4987231,4985340,4983785,4983613,4822630,4681547,4602029,4601010,4546295,4533498,4529854,4526816,4526787,4524189,4401833,4080687,4033150,3986687,3977492,160600,96257,1456451,157207,162815,154874,149434,2661944,2666480,3855719,1980207,4055598,162816,160964,155798,4259731,3569061,166942,112144,112362,1467932,158802,100349,100288,true,1113,708,739,753,773,236,96,112,1326,1173,1224,1311,1315,407,59,64,428,438,451,476,499,500,1390,554,619,664,1395,36,105,95,144,205,219,229,256,267,325]
#7
⏱️ 8.27 мс
select * from "stores" where "stores"."id" in (36, 95, 96, 105, 112, 144, 325, 407, 739)
#8
⏱️ 37.08 мс
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 = 160600 THEN 4526816 WHEN sp.master_product_id = 96257 THEN 4526816 WHEN sp.master_product_id = 1456451 THEN 4526816 WHEN sp.master_product_id = 4526816 THEN 4526816 WHEN sp.master_product_id = 157207 THEN 4526816 WHEN sp.master_product_id = 162815 THEN 4526816 WHEN sp.master_product_id = 154874 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 = 155798 THEN 4681547 WHEN sp.master_product_id = 4259731 THEN 4681547 WHEN sp.master_product_id = 3569061 THEN 4681547 WHEN sp.master_product_id = 166942 THEN 4681547 WHEN sp.master_product_id = 112144 THEN 4681547 WHEN sp.master_product_id = 4681547 THEN 4681547 WHEN sp.master_product_id = 7529293 THEN 7529293 WHEN sp.master_product_id = 112362 THEN 7529293 WHEN sp.master_product_id = 1467932 THEN 4602029 WHEN sp.master_product_id = 4602029 THEN 4602029 WHEN sp.master_product_id = 158802 THEN 4529854 WHEN sp.master_product_id = 4529854 THEN 4529854 WHEN sp.master_product_id = 100349 THEN 3986687 WHEN sp.master_product_id = 100288 THEN 3986687 WHEN sp.master_product_id = 3986687 THEN 3986687 ELSE sp.master_product_id END limit 500
Bindings:
[8775532,8775509,7529293,7522489,7514223,7493489,7429691,7182537,4991092,4987921,4987920,4987918,4987624,4987231,4985340,4983785,4983613,4822630,4681547,4602029,4601010,4546295,4533498,4529854,4526816,4526787,4524189,4401833,4080687,4033150,3986687,3977492,160600,96257,1456451,157207,162815,154874,149434,2661944,2666480,3855719,1980207,4055598,162816,160964,155798,4259731,3569061,166942,112144,112362,1467932,158802,100349,100288,0,1113,708,739,753,773,236,96,112,1326,1173,1224,1311,1315,407,59,64,428,438,451,476,499,500,1390,554,619,664,1395,36,105,95,144,205,219,229,256,267,325]
#9
⏱️ 46.35 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5482342,5465304,6339641,6332188,70789917,4538133,4512128,4522695,4684311,4654087,6526460,545815,541733,5402000,581142,577234,4747159,4732489,5377172,1476663,1478692,1991098,1994678,33142261,31021981,1998613,2128586,2131827,31153753,29502678,10768789,11180831,11186710,11175604,33432012,29720044,2287413,31636096,47551027,33755580,78503073,2586710,47801641,30346680,47803257,79888468,2594661,12235425,30352754,12236427,47814254,72738053,24772941,24772541,3564584,3564583,3562601,2996470,2990738,12333647,12319302,12322121,12326517,12326910,12327704,12327706,12327707,12333684,77773123,24317794,3334133,3333992,24337486,3337400,4107742,3946578,9559913,9560419,10280848,10285807,26477158,10284110,7749926,12013723,7759772,12021350,2797056,2800867,7771964,7757798,2796143,12024372,3140601,3140704,3142259,3144150,3144543,3144837,3144839,3144840,3140638]
#10
⏱️ 2.81 мс
select * from "stores" where "stores"."id" in (36, 95, 96, 105, 112, 144, 219, 325, 407, 428, 438, 451, 476, 499, 500, 554, 619, 708, 739, 753, 773)
#11
⏱️ 7.47 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["netanya"]
#12
⏱️ 10.15 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 8.41 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]