]> granicus.if.org Git - postgresql/commit
Make some small planner API cleanups.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Jan 2019 20:26:44 +0000 (15:26 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Jan 2019 20:26:44 +0000 (15:26 -0500)
commita1b8c41e990ec0f083e9b684700a07640d5a356a
treedaa26b95223c1e2a09507973853aa77b91df7644
parente77cfa54d700557ea700d47454c9e570f20f1841
Make some small planner API cleanups.

Move a few very simple node-creation and node-type-testing functions
from the planner's clauses.c to nodes/makefuncs and nodes/nodeFuncs.
There's nothing planner-specific about them, as evidenced by the
number of other places that were using them.

While at it, rename and_clause() etc to is_andclause() etc, to clarify
that they are node-type-testing functions not node-creation functions.
And use "static inline" implementations for the shortest ones.

Also, modify flatten_join_alias_vars() and some subsidiary functions
to take a Query not a PlannerInfo to define the join structure that
Vars should be translated according to.  They were only using the
"parse" field of the PlannerInfo anyway, so this just requires removing
one level of indirection.  The advantage is that now parse_agg.c can
use flatten_join_alias_vars() without the horrid kluge of creating an
incomplete PlannerInfo, which will allow that file to be decoupled from
relation.h in a subsequent patch.

Discussion: https://postgr.es/m/11460.1548706639@sss.pgh.pa.us
30 files changed:
src/backend/commands/explain.c
src/backend/executor/nodeSubplan.c
src/backend/executor/nodeTidscan.c
src/backend/nodes/makefuncs.c
src/backend/nodes/print.c
src/backend/optimizer/path/clausesel.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/joinrels.c
src/backend/optimizer/path/tidpath.c
src/backend/optimizer/plan/initsplan.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/prep/prepjointree.c
src/backend/optimizer/prep/prepqual.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/orclauses.c
src/backend/optimizer/util/predtest.c
src/backend/optimizer/util/restrictinfo.c
src/backend/optimizer/util/var.c
src/backend/parser/parse_agg.c
src/backend/partitioning/partprune.c
src/backend/statistics/dependencies.c
src/backend/utils/cache/relcache.c
src/include/nodes/makefuncs.h
src/include/nodes/nodeFuncs.h
src/include/optimizer/clauses.h
src/include/optimizer/prep.h
src/include/optimizer/var.h
src/test/modules/test_predtest/test_predtest.c