Content-Length: 277757 | pFad | http://github.com/postgrespro/postgres/commit/1b2c29469a58cd9086bd86e20c708eb437564a80

4C Fix HashAgg regression from choosing too many initial buckets. · postgrespro/postgres@1b2c294 · GitHub
Skip to content

Commit 1b2c294

Browse files
committed
Fix HashAgg regression from choosing too many initial buckets.
Diagnosis by Andres. Reported-by: Pavel Stehule Discussion: https://postgr.es/m/CAFj8pRDLVakD5Aagt3yZeEQeTeEWaS3YE5h8XC3Q3qJ6TYkc2Q%40mail.gmail.com Backpatch-through: 13
1 parent 47c7187 commit 1b2c294

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/backend/executor/nodeAgg.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,6 @@
294294
#define HASHAGG_READ_BUFFER_SIZE BLCKSZ
295295
#define HASHAGG_WRITE_BUFFER_SIZE BLCKSZ
296296

297-
/* minimum number of initial hash table buckets */
298-
#define HASHAGG_MIN_BUCKETS 256
299-
300297
/*
301298
* Estimate chunk overhead as a constant 16 bytes. XXX: should this be
302299
* improved?
@@ -1926,9 +1923,8 @@ hash_choose_num_buckets(double hashentrysize, long ngroups, Size memory)
19261923

19271924
if (nbuckets > max_nbuckets)
19281925
nbuckets = max_nbuckets;
1929-
if (nbuckets < HASHAGG_MIN_BUCKETS)
1930-
nbuckets = HASHAGG_MIN_BUCKETS;
1931-
return nbuckets;
1926+
1927+
return Max(nbuckets, 1);
19321928
}
19331929

19341930
/*

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/1b2c29469a58cd9086bd86e20c708eb437564a80

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy