pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Treat aggregate direct arguments as per-agg data not per-trans d
Date: Mon, 16 Oct 2017 20:02:59 +0000
Message-ID: <E1e4BbH-0003kW-4M@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Treat aggregate direct arguments as per-agg data not per-trans data.

There is no reason to insist that direct arguments must match before
we can merge transition states of two aggregate calls.  They're only
used during the finalfn call, so we can treat them as like the finalfn
itself.  This allows, eg, merging of

select
  percentile_cont(0.25) within group (order by a),
  percentile_disc(0.5) within group (order by a)
from ...

This didn't matter (and could not have been tested) before we allowed
state merging of OSAs otherwise.

Discussion: https://postgr.es/m/CAB4ELO5RZhOamuT9Xsf72ozbenDLLXZKSk07FiSVsuJNZB861A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cf5ba7c30c0428f5ff49197ec1e0f052035300d6

Modified Files
--------------
src/backend/executor/nodeAgg.c | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1e4BbH-0003kW-4M@gemulon.postgresql.org>
Permalink:  ../E1e4BbH-0003kW-4M@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1e4BbH-0003kW-4M@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Treat aggregate direct arguments as per-agg data not per-trans d
  In-Reply-To: <E1e4BbH-0003kW-4M@gemulon.postgresql.org>
  References: <E1e4BbH-0003kW-4M@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox