aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/selfuncs.c6
-rw-r--r--src/backend/utils/misc/guc.c54
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample10
3 files changed, 38 insertions, 32 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 5aeadce0917..c75ceef3732 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.205 2006/05/02 11:28:55 teodor Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.206 2006/06/05 02:49:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4555,9 +4555,9 @@ genericcostestimate(PlannerInfo *root,
* Compute the index access cost.
*
* Disk cost: our generic assumption is that the index pages will be read
- * sequentially, so they have cost 1.0 each, not random_page_cost.
+ * sequentially, so they cost seq_page_cost each, not random_page_cost.
*/
- *indexTotalCost = numIndexPages;
+ *indexTotalCost = seq_page_cost * numIndexPages;
/*
* CPU cost: any complex expressions in the indexquals will need to be
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 1ff2e0c8318..9ef561d4c12 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.320 2006/05/21 20:10:42 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.321 2006/06/05 02:49:58 tgl Exp $
*
*--------------------------------------------------------------------
*/
@@ -1595,57 +1595,63 @@ static struct config_int ConfigureNamesInt[] =
static struct config_real ConfigureNamesReal[] =
{
{
- {"effective_cache_size", PGC_USERSET, QUERY_TUNING_COST,
- gettext_noop("Sets the planner's assumption about size of the disk cache."),
- gettext_noop("That is, the portion of the kernel's disk cache that "
- "will be used for PostgreSQL data files. This is measured in disk "
- "pages, which are normally 8 kB each.")
+ {"seq_page_cost", PGC_USERSET, QUERY_TUNING_COST,
+ gettext_noop("Sets the planner's estimate of the cost of a "
+ "sequentially fetched disk page."),
+ NULL
},
- &effective_cache_size,
- DEFAULT_EFFECTIVE_CACHE_SIZE, 1, DBL_MAX, NULL, NULL
+ &seq_page_cost,
+ DEFAULT_SEQ_PAGE_COST, 0, DBL_MAX, NULL, NULL
},
{
{"random_page_cost", PGC_USERSET, QUERY_TUNING_COST,
- gettext_noop("Sets the planner's estimate of the cost of a nonsequentially "
- "fetched disk page."),
- gettext_noop("This is measured as a multiple of the cost of a "
- "sequential page fetch. A higher value makes it more likely a "
- "sequential scan will be used, a lower value makes it more likely an "
- "index scan will be used.")
+ gettext_noop("Sets the planner's estimate of the cost of a "
+ "nonsequentially fetched disk page."),
+ NULL
},
&random_page_cost,
DEFAULT_RANDOM_PAGE_COST, 0, DBL_MAX, NULL, NULL
},
{
{"cpu_tuple_cost", PGC_USERSET, QUERY_TUNING_COST,
- gettext_noop("Sets the planner's estimate of the cost of processing each tuple (row)."),
- gettext_noop("This is measured as a fraction of the cost of a "
- "sequential page fetch.")
+ gettext_noop("Sets the planner's estimate of the cost of "
+ "processing each tuple (row)."),
+ NULL
},
&cpu_tuple_cost,
DEFAULT_CPU_TUPLE_COST, 0, DBL_MAX, NULL, NULL
},
{
{"cpu_index_tuple_cost", PGC_USERSET, QUERY_TUNING_COST,
- gettext_noop("Sets the planner's estimate of processing cost for each "
- "index tuple (row) during index scan."),
- gettext_noop("This is measured as a fraction of the cost of a "
- "sequential page fetch.")
+ gettext_noop("Sets the planner's estimate of the cost of "
+ "processing each index entry during an index scan."),
+ NULL
},
&cpu_index_tuple_cost,
DEFAULT_CPU_INDEX_TUPLE_COST, 0, DBL_MAX, NULL, NULL
},
{
{"cpu_operator_cost", PGC_USERSET, QUERY_TUNING_COST,
- gettext_noop("Sets the planner's estimate of processing cost of each operator in WHERE."),
- gettext_noop("This is measured as a fraction of the cost of a sequential "
- "page fetch.")
+ gettext_noop("Sets the planner's estimate of the cost of "
+ "processing each operator or function call."),
+ NULL
},
&cpu_operator_cost,
DEFAULT_CPU_OPERATOR_COST, 0, DBL_MAX, NULL, NULL
},
{
+ {"effective_cache_size", PGC_USERSET, QUERY_TUNING_COST,
+ gettext_noop("Sets the planner's assumption about size of the disk cache."),
+ gettext_noop("That is, the portion of the kernel's disk cache that "
+ "will be used for PostgreSQL data files. This is measured in disk "
+ "pages, which are normally 8 kB each.")
+ },
+ &effective_cache_size,
+ DEFAULT_EFFECTIVE_CACHE_SIZE, 1, DBL_MAX, NULL, NULL
+ },
+
+ {
{"geqo_selection_bias", PGC_USERSET, QUERY_TUNING_GEQO,
gettext_noop("GEQO: selective pressure within the population."),
NULL
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index d7f32256d11..0499223d110 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -175,12 +175,12 @@
# - Planner Cost Constants -
+#seq_page_cost = 1.0 # measured on an arbitrary scale
+#random_page_cost = 4.0 # same scale as above
+#cpu_tuple_cost = 0.01 # same scale as above
+#cpu_index_tuple_cost = 0.001 # same scale as above
+#cpu_operator_cost = 0.0025 # same scale as above
#effective_cache_size = 1000 # typically 8KB each
-#random_page_cost = 4 # units are one sequential page fetch
- # cost
-#cpu_tuple_cost = 0.01 # (same)
-#cpu_index_tuple_cost = 0.001 # (same)
-#cpu_operator_cost = 0.0025 # (same)
# - Genetic Query Optimizer -