From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Simplify planner's final setup of Aggrefs for partial aggregatio
Date: Sun, 26 Jun 2016 16:09:01 +0000
Message-ID: <E1bHCcH-0005BX-Ob@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Simplify planner's final setup of Aggrefs for partial aggregation.
Commit e06a38965's original coding for constructing the execution-time
expression tree for a combining aggregate was rather messy, involving
duplicating quite a lot of code in setrefs.c so that it could inject
a nonstandard matching rule for Aggrefs. Get rid of that in favor of
explicitly constructing a combining Aggref with a partial Aggref as input,
then allowing setref's normal matching logic to match the partial Aggref
to the output of the lower plan node and hence replace it with a Var.
In passing, rename and redocument make_partialgroup_input_target to have
some connection to what it actually does.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/59a3795c2589a0e6dfe4d9a886de9423b3f8b057
Modified Files
--------------
src/backend/optimizer/plan/planner.c | 126 ++++++++++----
src/backend/optimizer/plan/setrefs.c | 325 +++++++++--------------------------
src/backend/optimizer/util/tlist.c | 51 ------
src/include/optimizer/planner.h | 2 +
src/include/optimizer/tlist.h | 1 -
5 files changed, 171 insertions(+), 334 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: Simplify planner's final setup of Aggrefs for partial aggregatio
In-Reply-To: <E1bHCcH-0005BX-Ob@gemulon.postgresql.org>
References: <E1bHCcH-0005BX-Ob@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