aboutsummaryrefslogtreecommitdiff
path: root/src/include/optimizer/cost.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/cost.h
parenta1b8c41e990ec0f083e9b684700a07640d5a356a (diff)
downloadpostgresql-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/include/optimizer/cost.h')
-rw-r--r--src/include/optimizer/cost.h34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 623f733d7df..48efbe58f7f 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -44,15 +44,7 @@ typedef enum
* routines to compute costs and sizes
*/
-/* parameter variables and flags */
-extern PGDLLIMPORT double seq_page_cost;
-extern PGDLLIMPORT double random_page_cost;
-extern PGDLLIMPORT double cpu_tuple_cost;
-extern PGDLLIMPORT double cpu_index_tuple_cost;
-extern PGDLLIMPORT double cpu_operator_cost;
-extern PGDLLIMPORT double parallel_tuple_cost;
-extern PGDLLIMPORT double parallel_setup_cost;
-extern PGDLLIMPORT int effective_cache_size;
+/* parameter variables and flags (see also optimizer.h) */
extern PGDLLIMPORT Cost disable_cost;
extern PGDLLIMPORT int max_parallel_workers_per_gather;
extern PGDLLIMPORT bool enable_seqscan;
@@ -74,7 +66,6 @@ extern PGDLLIMPORT bool enable_parallel_hash;
extern PGDLLIMPORT bool enable_partition_pruning;
extern PGDLLIMPORT int constraint_exclusion;
-extern double clamp_row_est(double nrows);
extern double index_pages_fetched(double tuples_fetched, BlockNumber pages,
double index_pages, PlannerInfo *root);
extern void cost_seqscan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
@@ -165,6 +156,10 @@ extern void final_cost_hashjoin(PlannerInfo *root, HashPath *path,
JoinPathExtraData *extra);
extern void cost_gather(GatherPath *path, PlannerInfo *root,
RelOptInfo *baserel, ParamPathInfo *param_info, double *rows);
+extern void cost_gather_merge(GatherMergePath *path, PlannerInfo *root,
+ RelOptInfo *rel, ParamPathInfo *param_info,
+ Cost input_startup_cost, Cost input_total_cost,
+ double *rows);
extern void cost_subplan(PlannerInfo *root, SubPlan *subplan, Plan *plan);
extern void cost_qual_eval(QualCost *cost, List *quals, PlannerInfo *root);
extern void cost_qual_eval_node(QualCost *cost, Node *qual, PlannerInfo *root);
@@ -204,23 +199,4 @@ extern PathTarget *set_pathtarget_cost_width(PlannerInfo *root, PathTarget *targ
extern double compute_bitmap_pages(PlannerInfo *root, RelOptInfo *baserel,
Path *bitmapqual, int loop_count, Cost *cost, double *tuple);
-/*
- * prototypes for clausesel.c
- * routines to compute clause selectivities
- */
-extern Selectivity clauselist_selectivity(PlannerInfo *root,
- List *clauses,
- int varRelid,
- JoinType jointype,
- SpecialJoinInfo *sjinfo);
-extern Selectivity clause_selectivity(PlannerInfo *root,
- Node *clause,
- int varRelid,
- JoinType jointype,
- SpecialJoinInfo *sjinfo);
-extern void cost_gather_merge(GatherMergePath *path, PlannerInfo *root,
- RelOptInfo *rel, ParamPathInfo *param_info,
- Cost input_startup_cost, Cost input_total_cost,
- double *rows);
-
#endif /* COST_H */