Re: Speed of user-defined aggregates using array_append as transfn

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Speed of user-defined aggregates using array_append as transfn
Date: 2016-10-29 19:23:45
Message-ID: 365.1477769025@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I'm still worried about chewing up a kilobyte-at-least for each transition
> value, but maybe that's something we could leave to fix later. Another
> idea is that we could teach the planner to know about that in its hash
> table size estimates.

Here's a complete proposed patch for this. I decided to hard-wire the
planner adjustment to apply to array_append specifically. One could
consider doing it whenever the aggregate transtype is an array type,
but that seems likely to be casting too wide a net for now. We can
revisit it in the future if necessary. In any case, the estimate
can be overridden per-aggregate using the aggtransspace parameter.

Barring objections, I intend to back-patch this as far as 9.5.

regards, tom lane

Attachment Content-Type Size
allow-expanded-aggregate-transvalues-3.patch text/x-diff 18.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gilles Darold 2016-10-29 20:00:08 Re: Patch to implement pg_current_logfile() function
Previous Message Tomas Vondra 2016-10-29 19:23:34 Re: multivariate statistics (v19)