Re: Additional size of hash table is alway zero for hash aggregates

From: Pengzhou Tang <ptang(at)pivotal(dot)io>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: Additional size of hash table is alway zero for hash aggregates
Date: 2020-03-14 00:51:14
Message-ID: CAG4reAT1kwRpOinKOy_1RmKzQM3a=hwXpfbwk5zejObj6ijt9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 13, 2020 at 8:34 AM Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
wrote:

> >>>>> "Justin" == Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
>
> > On Thu, Mar 12, 2020 at 12:16:26PM -0700, Andres Freund wrote:
> >> Indeed, that's incorrect. Causes the number of buckets for the
> >> hashtable to be set higher - the size is just used for that. I'm a
> >> bit wary of changing this in the stable branches - could cause
> >> performance changes?
>
> I think (offhand, not tested) that the number of buckets would only be
> affected if the (planner-supplied) numGroups value would cause work_mem
> to be exceeded; the planner doesn't plan a hashagg at all in that case
> unless forced to (grouping by a hashable but not sortable column). Note
> that for various reasons the planner tends to over-estimate the memory
> requirement anyway.
>
>
That makes sense, thanks

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-03-14 01:41:50 Re: RETURNING does not explain evaluation context for subqueries
Previous Message Pengzhou Tang 2020-03-14 00:50:55 Re: Additional size of hash table is alway zero for hash aggregates