summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorRobert Haas2016-03-23 11:57:46 +0000
committerRobert Haas2016-03-23 11:57:46 +0000
commit0336843939401dab8d8fbfe75e0631fea5d4c060 (patch)
treef6dae5de5651a4a231044f56f7c860bc816dcf0a /src/include
parentb283096534b9c514a92a70c98c033015b6792ba7 (diff)
not all jointypes done - rest in theory isserial_cost
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/amapi.h1
-rw-r--r--src/include/nodes/plannodes.h1
-rw-r--r--src/include/nodes/relation.h11
-rw-r--r--src/include/optimizer/cost.h13
-rw-r--r--src/include/utils/index_selfuncs.h6
5 files changed, 22 insertions, 10 deletions
diff --git a/src/include/access/amapi.h b/src/include/access/amapi.h
index 35f1061b3a..908b0d11dc 100644
--- a/src/include/access/amapi.h
+++ b/src/include/access/amapi.h
@@ -65,6 +65,7 @@ typedef void (*amcostestimate_function) (struct PlannerInfo *root,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
+ Cost *indexSerialCost,
Selectivity *indexSelectivity,
double *indexCorrelation);
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index 00b1d35d75..30e5a97afb 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -102,6 +102,7 @@ typedef struct Plan
*/
Cost startup_cost; /* cost expended before fetching any tuples */
Cost total_cost; /* total cost (assuming all tuples fetched) */
+ Cost serial_cost; /* non-parallelizable portion of total cost */
/*
* planner's estimate of result size of this plan step
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index ee7007aace..26417291e6 100644
--- a/src/include/nodes/relation.h
+++ b/src/include/nodes/relation.h
@@ -845,6 +845,7 @@ typedef struct Path
double rows; /* estimated number of result tuples */
Cost startup_cost; /* cost expended before fetching any tuples */
Cost total_cost; /* total cost (assuming all tuples fetched) */
+ Cost serial_cost; /* non-parallelizable portion of total cost */
List *pathkeys; /* sort ordering of path's output */
/* pathkeys is a List of PathKey nodes; see above */
@@ -900,10 +901,11 @@ typedef struct Path
* NoMovementScanDirection for an indexscan, but the planner wants to
* distinguish ordered from unordered indexes for building pathkeys.)
*
- * 'indextotalcost' and 'indexselectivity' are saved in the IndexPath so that
- * we need not recompute them when considering using the same index in a
- * bitmap index/heap scan (see BitmapHeapPath). The costs of the IndexPath
- * itself represent the costs of an IndexScan or IndexOnlyScan plan type.
+ * 'indextotalcost', 'indexserialcost', and 'indexselectivity' are saved in
+ * the IndexPath so that we need not recompute them when considering using the
+ * same index in a * bitmap index/heap scan (see BitmapHeapPath). The costs
+ * of the IndexPath itself represent the costs of an IndexScan or IndexOnlyScan
+ * plan type.
*----------
*/
typedef struct IndexPath
@@ -917,6 +919,7 @@ typedef struct IndexPath
List *indexorderbycols;
ScanDirection indexscandir;
Cost indextotalcost;
+ Cost indexserialcost;
Selectivity indexselectivity;
} IndexPath;
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index d4adca6836..6e693d498f 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -82,7 +82,8 @@ extern void cost_bitmap_heap_scan(Path *path, PlannerInfo *root, RelOptInfo *bas
Path *bitmapqual, double loop_count);
extern void cost_bitmap_and_node(BitmapAndPath *path, PlannerInfo *root);
extern void cost_bitmap_or_node(BitmapOrPath *path, PlannerInfo *root);
-extern void cost_bitmap_tree_node(Path *path, Cost *cost, Selectivity *selec);
+extern void cost_bitmap_tree_node(Path *path, Cost *total_cost,
+ Cost *serial_cost, Selectivity *selec);
extern void cost_tidscan(Path *path, PlannerInfo *root,
RelOptInfo *baserel, List *tidquals, ParamPathInfo *param_info);
extern void cost_subqueryscan(SubqueryScanPath *path, PlannerInfo *root,
@@ -101,23 +102,23 @@ extern void cost_sort(Path *path, PlannerInfo *root,
extern void cost_merge_append(Path *path, PlannerInfo *root,
List *pathkeys, int n_streams,
Cost input_startup_cost, Cost input_total_cost,
- double tuples);
+ Cost input_serial_cost, double tuples);
extern void cost_material(Path *path,
Cost input_startup_cost, Cost input_total_cost,
- double tuples, int width);
+ Cost input_serial_cost, double tuples, int width);
extern void cost_agg(Path *path, PlannerInfo *root,
AggStrategy aggstrategy, const AggClauseCosts *aggcosts,
int numGroupCols, double numGroups,
Cost input_startup_cost, Cost input_total_cost,
- double input_tuples);
+ Cost input_serial_cost, double input_tuples);
extern void cost_windowagg(Path *path, PlannerInfo *root,
List *windowFuncs, int numPartCols, int numOrderCols,
Cost input_startup_cost, Cost input_total_cost,
- double input_tuples);
+ Cost input_serial_cost, double input_tuples);
extern void cost_group(Path *path, PlannerInfo *root,
int numGroupCols, double numGroups,
Cost input_startup_cost, Cost input_total_cost,
- double input_tuples);
+ Cost input_serial_cost, double input_tuples);
extern void initial_cost_nestloop(PlannerInfo *root,
JoinCostWorkspace *workspace,
JoinType jointype,
diff --git a/src/include/utils/index_selfuncs.h b/src/include/utils/index_selfuncs.h
index a03e12f518..2e051b74f4 100644
--- a/src/include/utils/index_selfuncs.h
+++ b/src/include/utils/index_selfuncs.h
@@ -27,6 +27,7 @@ extern void brincostestimate(struct PlannerInfo *root,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
+ Cost *indexSerialCost,
Selectivity *indexSelectivity,
double *indexCorrelation);
extern void btcostestimate(struct PlannerInfo *root,
@@ -34,6 +35,7 @@ extern void btcostestimate(struct PlannerInfo *root,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
+ Cost *indexSerialCost,
Selectivity *indexSelectivity,
double *indexCorrelation);
extern void hashcostestimate(struct PlannerInfo *root,
@@ -41,6 +43,7 @@ extern void hashcostestimate(struct PlannerInfo *root,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
+ Cost *indexSerialCost,
Selectivity *indexSelectivity,
double *indexCorrelation);
extern void gistcostestimate(struct PlannerInfo *root,
@@ -48,6 +51,7 @@ extern void gistcostestimate(struct PlannerInfo *root,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
+ Cost *indexSerialCost,
Selectivity *indexSelectivity,
double *indexCorrelation);
extern void spgcostestimate(struct PlannerInfo *root,
@@ -55,6 +59,7 @@ extern void spgcostestimate(struct PlannerInfo *root,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
+ Cost *indexSerialCost,
Selectivity *indexSelectivity,
double *indexCorrelation);
extern void gincostestimate(struct PlannerInfo *root,
@@ -62,6 +67,7 @@ extern void gincostestimate(struct PlannerInfo *root,
double loop_count,
Cost *indexStartupCost,
Cost *indexTotalCost,
+ Cost *indexSerialCost,
Selectivity *indexSelectivity,
double *indexCorrelation);