diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-01-29 15:48:51 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-01-29 15:48:51 -0500 |
commit | f09346a9c6218dd239fdf3a79a729716c0d305bd (patch) | |
tree | d33b3c1a0770578079e94991384923280991a252 /src/backend/utils/cache | |
parent | a1b8c41e990ec0f083e9b684700a07640d5a356a (diff) | |
download | postgresql-f09346a9c6218dd239fdf3a79a729716c0d305bd.tar.gz postgresql-f09346a9c6218dd239fdf3a79a729716c0d305bd.zip |
Refactor planner's header files.
Create a new header optimizer/optimizer.h, which exposes just the
planner functions that can be used "at arm's length", without need
to access Paths or the other planner-internal data structures defined
in nodes/relation.h. This is intended to provide the whole planner
API seen by most of the rest of the system; although FDWs still need
to use additional stuff, and more thought is also needed about just
what selfuncs.c should rely on.
The main point of doing this now is to limit the amount of new
#include baggage that will be needed by "planner support functions",
which I expect to introduce later, and which will be in relevant
datatype modules rather than anywhere near the planner.
This commit just moves relevant declarations into optimizer.h from
other header files (a couple of which go away because everything
got moved), and adjusts #include lists to match. There's further
cleanup that could be done if we want to decide that some stuff
being exposed by optimizer.h doesn't belong in the planner at all,
but I'll leave that for another day.
Discussion: https://postgr.es/m/11460.1548706639@sss.pgh.pa.us
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/partcache.c | 3 | ||||
-rw-r--r-- | src/backend/utils/cache/plancache.c | 5 | ||||
-rw-r--r-- | src/backend/utils/cache/relcache.c | 4 | ||||
-rw-r--r-- | src/backend/utils/cache/spccache.c | 2 | ||||
-rw-r--r-- | src/backend/utils/cache/typcache.c | 2 |
5 files changed, 5 insertions, 11 deletions
diff --git a/src/backend/utils/cache/partcache.c b/src/backend/utils/cache/partcache.c index 2404073bc86..1b50f283c55 100644 --- a/src/backend/utils/cache/partcache.c +++ b/src/backend/utils/cache/partcache.c @@ -25,8 +25,7 @@ #include "miscadmin.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" -#include "optimizer/clauses.h" -#include "optimizer/planner.h" +#include "optimizer/optimizer.h" #include "partitioning/partbounds.h" #include "utils/builtins.h" #include "utils/datum.h" diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c index 3f46b5dfb23..9851bd43d5c 100644 --- a/src/backend/utils/cache/plancache.c +++ b/src/backend/utils/cache/plancache.c @@ -61,10 +61,7 @@ #include "executor/executor.h" #include "miscadmin.h" #include "nodes/nodeFuncs.h" -#include "optimizer/cost.h" -#include "optimizer/planmain.h" -#include "optimizer/planner.h" -#include "optimizer/prep.h" +#include "optimizer/optimizer.h" #include "parser/analyze.h" #include "parser/parsetree.h" #include "storage/lmgr.h" diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 12bba1b63a0..af96a033385 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -71,9 +71,7 @@ #include "miscadmin.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" -#include "optimizer/clauses.h" -#include "optimizer/prep.h" -#include "optimizer/var.h" +#include "optimizer/optimizer.h" #include "partitioning/partbounds.h" #include "rewrite/rewriteDefine.h" #include "rewrite/rowsecurity.h" diff --git a/src/backend/utils/cache/spccache.c b/src/backend/utils/cache/spccache.c index 1d0c16bf481..6309a017c18 100644 --- a/src/backend/utils/cache/spccache.c +++ b/src/backend/utils/cache/spccache.c @@ -22,7 +22,7 @@ #include "catalog/pg_tablespace.h" #include "commands/tablespace.h" #include "miscadmin.h" -#include "optimizer/cost.h" +#include "optimizer/optimizer.h" #include "storage/bufmgr.h" #include "utils/catcache.h" #include "utils/hsearch.h" diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index 2fb7dd3b8e3..7857424c2c1 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -59,7 +59,7 @@ #include "commands/defrem.h" #include "executor/executor.h" #include "lib/dshash.h" -#include "optimizer/planner.h" +#include "optimizer/optimizer.h" #include "storage/lwlock.h" #include "utils/builtins.h" #include "utils/catcache.h" |