From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Simplify planner's final setup of Aggrefs for partial aggregatio |
Date: | 2016-06-26 16:09:01 |
Message-ID: | E1bHCcH-0005BX-Ob@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2016-06-26 18:33:52 | pgsql: Rethink node-level representation of partial-aggregation modes. |
Previous Message | Alvaro Herrera | 2016-06-24 22:41:58 | pgsql: Fix handling of multixacts predating pg_upgrade |