Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1b2c294

Browse filesBrowse 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
Copy full SHA for 1b2c294

File tree

Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed

‎src/backend/executor/nodeAgg.c

Copy file name to clipboardExpand all lines: src/backend/executor/nodeAgg.c
+2-6Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.