mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
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
This commit is contained in:
parent
de4a259896
commit
2174d40117
@ -294,9 +294,6 @@
|
|||||||
#define HASHAGG_READ_BUFFER_SIZE BLCKSZ
|
#define HASHAGG_READ_BUFFER_SIZE BLCKSZ
|
||||||
#define HASHAGG_WRITE_BUFFER_SIZE BLCKSZ
|
#define HASHAGG_WRITE_BUFFER_SIZE BLCKSZ
|
||||||
|
|
||||||
/* minimum number of initial hash table buckets */
|
|
||||||
#define HASHAGG_MIN_BUCKETS 256
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Estimate chunk overhead as a constant 16 bytes. XXX: should this be
|
* Estimate chunk overhead as a constant 16 bytes. XXX: should this be
|
||||||
* improved?
|
* improved?
|
||||||
@ -1926,9 +1923,8 @@ hash_choose_num_buckets(double hashentrysize, long ngroups, Size memory)
|
|||||||
|
|
||||||
if (nbuckets > max_nbuckets)
|
if (nbuckets > max_nbuckets)
|
||||||
nbuckets = max_nbuckets;
|
nbuckets = max_nbuckets;
|
||||||
if (nbuckets < HASHAGG_MIN_BUCKETS)
|
|
||||||
nbuckets = HASHAGG_MIN_BUCKETS;
|
return Max(nbuckets, 1);
|
||||||
return nbuckets;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user