Re: Spilling hashed SetOps and aggregates to disk

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: Spilling hashed SetOps and aggregates to disk
Date: 2018-06-05 17:27:01
Message-ID: 4223.1528219621@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Fetter <david(at)fetter(dot)org> writes:
> On Tue, Jun 05, 2018 at 02:56:23PM +1200, David Rowley wrote:
>> True. Although not all built in aggregates have those defined.

> Just out of curiosity, which ones don't? As of
> 3f85c62d9e825eedd1315d249ef1ad793ca78ed4, pg_aggregate has both of
> those as NOT NULL.

NOT NULL isn't too relevant; that's just protecting the fixed-width
nature of the catalog rows. What's important is which ones are zero.

# select aggfnoid::regprocedure, aggkind from pg_aggregate where (aggserialfn=0 or aggdeserialfn=0) and aggtranstype = 'internal'::regtype;
aggfnoid | aggkind
------------------------------------------------------+---------
array_agg(anynonarray) | n
array_agg(anyarray) | n
string_agg(text,text) | n
string_agg(bytea,bytea) | n
json_agg(anyelement) | n
json_object_agg("any","any") | n
jsonb_agg(anyelement) | n
jsonb_object_agg("any","any") | n
percentile_disc(double precision,anyelement) | o
percentile_cont(double precision,double precision) | o
percentile_cont(double precision,interval) | o
percentile_disc(double precision[],anyelement) | o
percentile_cont(double precision[],double precision) | o
percentile_cont(double precision[],interval) | o
mode(anyelement) | o
rank("any") | h
percent_rank("any") | h
cume_dist("any") | h
dense_rank("any") | h
(19 rows)

Probably the ordered-set/hypothetical ones aren't relevant for this
issue.

Whether or not we feel like fixing the above "normal" aggs for this,
the patch would have to not fail on extension aggregates that don't
support serialization.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-06-05 17:28:54 Re: [PATCH] Trim trailing whitespace in vim and emacs
Previous Message Chris Travers 2018-06-05 17:26:06 Re: Code of Conduct plan