Move per-agg and per-trans duplicate finding to the planner.
authorHeikki Linnakangas <[email protected]>
Tue, 24 Nov 2020 08:45:00 +0000 (10:45 +0200)
committerHeikki Linnakangas <[email protected]>
Tue, 24 Nov 2020 08:45:00 +0000 (10:45 +0200)
commit0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b
tree8f630f828fa6bbfb5984f037118211cd68d8a50e
parente522024bd8dd28a0f13dcccfd39170698f45c939
Move per-agg and per-trans duplicate finding to the planner.

This has the advantage that the cost estimates for aggregates can count
the number of calls to transition and final functions correctly.

Bump catalog version, because views can contain Aggrefs.

Reviewed-by: Andres Freund
Discussion: https://www.postgresql.org/message-id/b2e3536b-1dbc-8303-c97e-89cb0b4a9a48%40iki.fi
29 files changed:
contrib/postgres_fdw/postgres_fdw.c
src/backend/executor/execExpr.c
src/backend/executor/execExprInterp.c
src/backend/executor/nodeAgg.c
src/backend/jit/llvm/llvmjit_expr.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/plan/planagg.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/Makefile
src/backend/optimizer/prep/prepagg.c [new file with mode: 0644]
src/backend/optimizer/util/clauses.c
src/backend/parser/parse_func.c
src/backend/utils/adt/selfuncs.c
src/include/catalog/catversion.h
src/include/executor/execExpr.h
src/include/nodes/execnodes.h
src/include/nodes/nodes.h
src/include/nodes/pathnodes.h
src/include/nodes/primnodes.h
src/include/optimizer/clauses.h
src/include/optimizer/prep.h
src/include/utils/selfuncs.h
src/test/regress/expected/partition_aggregate.out
src/test/regress/sql/partition_aggregate.sql
src/tools/pgindent/typedefs.list