diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-06-05 02:49:58 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-06-05 02:49:58 +0000 |
commit | eed6c9ed7e243948e440ed1388591b7fa28f5827 (patch) | |
tree | aef8821bdd57ed83e2c1b2ce27014e45beed0934 /src/backend/utils/misc/guc.c | |
parent | a837851dc060515c1f7023f74d75156a80c2c936 (diff) |
Add a GUC parameter seq_page_cost, and use that everywhere we formerly
assumed that a sequential page fetch has cost 1.0. This patch doesn't
in itself change the system's behavior at all, but it opens the door to
people adopting other units of measurement for EXPLAIN costs. Also, if
we ever decide it's worth inventing per-tablespace access cost settings,
this change provides a workable intellectual framework for that.
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 54 |
1 files changed, 30 insertions, 24 deletions
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 |