#1
⏱️ 181.9 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"petah-tikva"]
#2
⏱️ 1408.22 мс
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",18,152,216,732,750,771,103,1145,1211,1239,1246,1262,1306,1328,1334,174,224,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,308,34,35,146,190,191,257,276,324,330,338,356,391,true,18,152,216,732,750,771,103,1145,1211,1239,1246,1262,1306,1328,1334,174,224,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,308,34,35,146,190,191,257,276,324,330,338,356,391,"produce"]
#3
⏱️ 1215.25 мс
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",18,152,216,732,750,771,103,1145,1211,1239,1246,1262,1306,1328,1334,174,224,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,308,34,35,146,190,191,257,276,324,330,338,356,391,true,18,152,216,732,750,771,103,1145,1211,1239,1246,1262,1306,1328,1334,174,224,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,308,34,35,146,190,191,257,276,324,330,338,356,391,"produce"]
#4
⏱️ 5.43 мс
select * from "canonical_products" where "canonical_products"."id" in (4, 16, 19, 28, 31, 37, 44, 84, 139, 159, 194)
#5
⏱️ 6.47 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[37,31,16,28,4,159,19,194,84,139,44]
#6
⏱️ 814.91 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,8506300,7569492,7568127,7565762,7562101,7561917,7557005,7550923,7549019,7529435,7523949,7472471,7466366,7461021,7455068,7454739,7446739,7431628,7428697,6908951,6744655,6708345,5130389,4991109,8775708,8775709,8775781,2190109,1454922,95625,165505,160965,195947,1941919,160641,1456452,190924,8775707,8775710,8775711,622184,4029456,195114,363774,8775712,4034737,2609947,7471561,115658,111499,157276,133509,154948,3619438,4042739,191901,96458,1952651,133472,154941,97843,157163,2712622,160958,189969,114703,115686,true,18,152,216,732,750,771,103,1145,1211,1239,1246,1262,1306,1328,1334,174,224,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,308,34,35,146,190,191,257,276,324,330,338,356,391]
#7
⏱️ 9.65 мс
select * from "stores" where "stores"."id" in (18, 34, 35, 103, 104, 146, 152, 276, 308, 324, 330, 338, 356, 391, 732)
#8
⏱️ 327.38 мс
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 = 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 = 7428697 THEN 7428697 WHEN sp.master_product_id = 2190109 THEN 7569492 WHEN sp.master_product_id = 1454922 THEN 7461021 WHEN sp.master_product_id = 7454739 THEN 7454739 WHEN sp.master_product_id = 7461021 THEN 7461021 WHEN sp.master_product_id = 95625 THEN 8506300 WHEN sp.master_product_id = 165505 THEN 7461021 WHEN sp.master_product_id = 160965 THEN 7428697 WHEN sp.master_product_id = 7557005 THEN 7557005 WHEN sp.master_product_id = 7561917 THEN 7561917 WHEN sp.master_product_id = 195947 THEN 7561917 WHEN sp.master_product_id = 1941919 THEN 7561917 WHEN sp.master_product_id = 160641 THEN 7557005 WHEN sp.master_product_id = 1456452 THEN 7561917 WHEN sp.master_product_id = 190924 THEN 8506300 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 = 8775782 THEN 8775782 WHEN sp.master_product_id = 622184 THEN 8506300 WHEN sp.master_product_id = 4029456 THEN 7529435 WHEN sp.master_product_id = 195114 THEN 7557005 WHEN sp.master_product_id = 8506300 THEN 8506300 WHEN sp.master_product_id = 363774 THEN 7557005 WHEN sp.master_product_id = 8775712 THEN 8775713 WHEN sp.master_product_id = 4034737 THEN 7569492 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 = 157276 THEN 7561917 WHEN sp.master_product_id = 133509 THEN 7569492 WHEN sp.master_product_id = 154948 THEN 7557005 WHEN sp.master_product_id = 7529435 THEN 7529435 WHEN sp.master_product_id = 3619438 THEN 8506300 WHEN sp.master_product_id = 7569492 THEN 7569492 WHEN sp.master_product_id = 4042739 THEN 7557005 WHEN sp.master_product_id = 191901 THEN 7561917 WHEN sp.master_product_id = 96458 THEN 7454739 WHEN sp.master_product_id = 1952651 THEN 7569492 WHEN sp.master_product_id = 133472 THEN 7454739 WHEN sp.master_product_id = 154941 THEN 8506300 WHEN sp.master_product_id = 97843 THEN 8506300 WHEN sp.master_product_id = 157163 THEN 7561917 WHEN sp.master_product_id = 2712622 THEN 7454739 WHEN sp.master_product_id = 160958 THEN 7557005 WHEN sp.master_product_id = 189969 THEN 7557005 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,8506300,7569492,7568127,7565762,7562101,7561917,7557005,7550923,7549019,7529435,7523949,7472471,7466366,7461021,7455068,7454739,7446739,7431628,7428697,6908951,6744655,6708345,5130389,4991109,8775708,8775709,8775781,2190109,1454922,95625,165505,160965,195947,1941919,160641,1456452,190924,8775707,8775710,8775711,622184,4029456,195114,363774,8775712,4034737,2609947,7471561,115658,111499,157276,133509,154948,3619438,4042739,191901,96458,1952651,133472,154941,97843,157163,2712622,160958,189969,114703,115686,0,18,152,216,732,750,771,103,1145,1211,1239,1246,1262,1306,1328,1334,174,224,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,308,34,35,146,190,191,257,276,324,330,338,356,391]
#9
⏱️ 92.04 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6061013,6058174,5534158,5530322,794104,793518,4241725,4236759,6546949,5173268,5167294,4847753,4841747,5344733,5340205,683008,682236,1045928,1044899,1063682,1062588,4362746,4359974,775999,775259,1354071,1353065,11032006,13429886,2250694,77941992,2250722,2241647,47617290,47611827,2527729,2527648,2530400,2529929,47613462,56560775,30247983,2530361,12075330,35935094,12258288,30369449,12258281,12260184,19030453,2610318,2610656,19032355,30371004,19038128,2610657,30368890,30370800,2605743,2610311,2610839,2609908,12258282,47870688,19043916,12263779,2612323,2614650,2613995,2614498,30376625,12262457,30374511,30376421,2614609,2615185,2614500,47865392,19043910,12269065,12268042,19061512,2616609,2618816,12276191,2622024,30381545,2616611,30379431,2616605,2622586,2616866,2616865,2618230,47889199,24765341,3550072,3551859,68526505,3550065,60410675,3680336,60403979,3678373,3702614,3703757,24930224,3702611,4024831,3835889,9557928,3828278,9560113,9560320,9560435,9560734,9570900,9581296,4066670,9613059,6780817,6777354,1735011,282181,1735042,3133022,7710327,2767010,2769203,7705385,2767844]
#10
⏱️ 9.75 мс
select * from "stores" where "stores"."id" in (18, 34, 35, 103, 104, 146, 152, 276, 308, 324, 330, 338, 356, 391, 448, 484, 503, 504, 505, 553, 575, 579, 732, 750, 771)
#11
⏱️ 9.79 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["petah-tikva"]
#12
⏱️ 10.23 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 12.55 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]