mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Fix costing for disk-based hash aggregation.
Report and suggestions from Richard Guo and Tomas Vondra. Discussion: https://postgr.es/m/CAMbWs4_W8fYbAn8KxgidAaZHON_Oo08OYn9ze=7remJymLqo5g@mail.gmail.com
This commit is contained in:
@ -1728,6 +1728,8 @@ hash_agg_set_limits(double hashentrysize, uint64 input_groups, int used_bits,
|
||||
/* if not expected to spill, use all of work_mem */
|
||||
if (input_groups * hashentrysize < work_mem * 1024L)
|
||||
{
|
||||
if (num_partitions != NULL)
|
||||
*num_partitions = 0;
|
||||
*mem_limit = work_mem * 1024L;
|
||||
*ngroups_limit = *mem_limit / hashentrysize;
|
||||
return;
|
||||
|
Reference in New Issue
Block a user