pgsql: Rethink node-level representation of partial-aggregation modes. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Rethink node-level representation of partial-aggregation modes.
Date
Msg-id E1bHEsS-0007YZ-QZ@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Rethink node-level representation of partial-aggregation modes.

The original coding had three separate booleans representing partial
aggregation behavior, which was confusing, unreadable, and error-prone,
not least because the booleans weren't always listed in the same order.
It was also inadequate for the allegedly-desirable future extension to
support intermediate partial aggregation, because we'd need separate
markers for serialization and deserialization in such a case.

Merge these bools into an enum "AggSplit" to provide symbolic names for
the supported operating modes (and document what those are).  By assigning
the values of the enum constants carefully, we can treat AggSplit values
as options bitmasks so that tests of what to do aren't noticeably more
expensive than before.

While at it, get rid of Aggref.aggoutputtype.  That's not needed since
commit 59a3795c2 got rid of setrefs.c's special-purpose Aggref comparison
code, and it likewise seemed more confusing than helpful.

Assorted comment cleanup as well (there's still more that I want to do
in that line).

catversion bump for change in Aggref node contents.  Should be the last
one for partial-aggregation changes.

Discussion: <29309.1466699160@sss.pgh.pa.us>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/19e972d5580c655423572e3c870e47b5b7c346f6

Modified Files
--------------
src/backend/commands/explain.c          |   4 +-
src/backend/executor/execQual.c         |  29 ++----
src/backend/executor/nodeAgg.c          | 173 ++++++++++++++------------------
src/backend/nodes/copyfuncs.c           |   8 +-
src/backend/nodes/equalfuncs.c          |   4 +-
src/backend/nodes/nodeFuncs.c           |   2 +-
src/backend/nodes/outfuncs.c            |   9 +-
src/backend/nodes/readfuncs.c           |   8 +-
src/backend/optimizer/plan/createplan.c |  23 ++---
src/backend/optimizer/plan/planner.c    |  97 +++++++++---------
src/backend/optimizer/plan/setrefs.c    |   8 +-
src/backend/optimizer/prep/prepunion.c  |   6 +-
src/backend/optimizer/util/clauses.c    |  85 +++++++---------
src/backend/optimizer/util/pathnode.c   |  13 +--
src/backend/parser/parse_func.c         |   6 +-
src/backend/utils/adt/ruleutils.c       |   9 +-
src/include/catalog/catversion.h        |   2 +-
src/include/nodes/execnodes.h           |   4 +-
src/include/nodes/nodes.h               |  30 ++++++
src/include/nodes/plannodes.h           |   4 +-
src/include/nodes/primnodes.h           |  21 ++--
src/include/nodes/relation.h            |   4 +-
src/include/optimizer/clauses.h         |   5 +-
src/include/optimizer/pathnode.h        |   6 +-
src/include/optimizer/planmain.h        |   4 +-
src/include/optimizer/planner.h         |   2 +-
26 files changed, 252 insertions(+), 314 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Simplify planner's final setup of Aggrefs for partial aggregatio
Next
From: Tom Lane
Date:
Subject: pgsql: Avoid making a separate pass over the query to check for partial