summaryrefslogtreecommitdiff
path: root/src/include/optimizer/cost.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/optimizer/cost.h')
-rw-r--r--src/include/optimizer/cost.h40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 79153c01d8..960a2ea9e9 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: cost.h,v 1.29 2000/02/07 04:41:04 tgl Exp $
+ * $Id: cost.h,v 1.30 2000/02/15 20:49:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -17,9 +17,12 @@
#include "nodes/relation.h"
/* defaults for costsize.c's Cost parameters */
-/* NB: cost-estimation code should use the variables, not the constants! */
-#define CPU_PAGE_WEIGHT 0.033
-#define CPU_INDEX_PAGE_WEIGHT 0.017
+/* NB: cost-estimation code should use the variables, not these constants! */
+#define DEFAULT_EFFECTIVE_CACHE_SIZE 1000.0 /* measured in pages */
+#define DEFAULT_RANDOM_PAGE_COST 4.0
+#define DEFAULT_CPU_TUPLE_COST 0.01
+#define DEFAULT_CPU_INDEX_TUPLE_COST 0.001
+#define DEFAULT_CPU_OPERATOR_COST 0.0025
/* defaults for function attributes used for expensive function calculations */
#define BYTE_PCT 100
@@ -33,8 +36,12 @@
* routines to compute costs and sizes
*/
-extern Cost cpu_page_weight;
-extern Cost cpu_index_page_weight;
+/* parameter variables and flags */
+extern double effective_cache_size;
+extern Cost random_page_cost;
+extern Cost cpu_tuple_cost;
+extern Cost cpu_index_tuple_cost;
+extern Cost cpu_operator_cost;
extern Cost disable_cost;
extern bool enable_seqscan;
extern bool enable_indexscan;
@@ -44,17 +51,20 @@ extern bool enable_nestloop;
extern bool enable_mergejoin;
extern bool enable_hashjoin;
-extern Cost cost_seqscan(RelOptInfo *baserel);
-extern Cost cost_index(Query *root, RelOptInfo *baserel, IndexOptInfo *index,
+extern void cost_seqscan(Path *path, RelOptInfo *baserel);
+extern void cost_index(Path *path, Query *root,
+ RelOptInfo *baserel, IndexOptInfo *index,
List *indexQuals, bool is_injoin);
-extern Cost cost_tidscan(RelOptInfo *baserel, List *tideval);
-extern Cost cost_sort(List *pathkeys, double tuples, int width);
-extern Cost cost_nestloop(Path *outer_path, Path *inner_path,
- bool is_indexjoin);
-extern Cost cost_mergejoin(Path *outer_path, Path *inner_path,
+extern void cost_tidscan(Path *path, RelOptInfo *baserel, List *tideval);
+extern void cost_sort(Path *path, List *pathkeys, double tuples, int width);
+extern void cost_nestloop(Path *path, Path *outer_path, Path *inner_path,
+ List *restrictlist, bool is_indexjoin);
+extern void cost_mergejoin(Path *path, Path *outer_path, Path *inner_path,
+ List *restrictlist,
List *outersortkeys, List *innersortkeys);
-extern Cost cost_hashjoin(Path *outer_path, Path *inner_path,
- Selectivity innerdisbursion);
+extern void cost_hashjoin(Path *path, Path *outer_path, Path *inner_path,
+ List *restrictlist, Selectivity innerdisbursion);
+extern Cost cost_qual_eval(List *quals);
extern void set_baserel_size_estimates(Query *root, RelOptInfo *rel);
extern void set_joinrel_size_estimates(Query *root, RelOptInfo *rel,
RelOptInfo *outer_rel,