summaryrefslogtreecommitdiff
path: root/src/include/optimizer/planner.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-01-29 15:48:51 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2019-01-29 15:48:51 -0500
commitf09346a9c6218dd239fdf3a79a729716c0d305bd (patch)
treed33b3c1a0770578079e94991384923280991a252 /src/include/optimizer/planner.h
parenta1b8c41e990ec0f083e9b684700a07640d5a356a (diff)
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/include/optimizer/planner.h')
-rw-r--r--src/include/optimizer/planner.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/include/optimizer/planner.h b/src/include/optimizer/planner.h
index 8616681e0a2..769a2f8e011 100644
--- a/src/include/optimizer/planner.h
+++ b/src/include/optimizer/planner.h
@@ -3,6 +3,10 @@
* planner.h
* prototypes for planner.c.
*
+ * Note that the primary entry points for planner.c are declared in
+ * optimizer/optimizer.h, because they're intended to be called from
+ * non-planner code. Declarations here are meant for use by other
+ * planner modules.
*
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
@@ -33,8 +37,6 @@ typedef void (*create_upper_paths_hook_type) (PlannerInfo *root,
extern PGDLLIMPORT create_upper_paths_hook_type create_upper_paths_hook;
-extern PlannedStmt *planner(Query *parse, int cursorOptions,
- ParamListInfo boundParams);
extern PlannedStmt *standard_planner(Query *parse, int cursorOptions,
ParamListInfo boundParams);
@@ -54,14 +56,6 @@ extern void mark_partial_aggref(Aggref *agg, AggSplit aggsplit);
extern Path *get_cheapest_fractional_path(RelOptInfo *rel,
double tuple_fraction);
-extern Expr *expression_planner(Expr *expr);
-extern Expr *expression_planner_with_deps(Expr *expr,
- List **relationOids,
- List **invalItems);
-
extern Expr *preprocess_phv_expression(PlannerInfo *root, Expr *expr);
-extern bool plan_cluster_use_sort(Oid tableOid, Oid indexOid);
-extern int plan_create_index_workers(Oid tableOid, Oid indexOid);
-
#endif /* PLANNER_H */