aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2006-07-26 11:35:56 +0000
committerPeter Eisentraut <peter_e@gmx.net>2006-07-26 11:35:56 +0000
commit79bc99a46703dc07636f4c9f09067f87b324c6b4 (patch)
treef59e44dc91563cd4be2efbb8a5cde3b7f3c64360
parent0c57c832b950192405004021c618315bbe786ddf (diff)
downloadpostgresql-79bc99a46703dc07636f4c9f09067f87b324c6b4.tar.gz
postgresql-79bc99a46703dc07636f4c9f09067f87b324c6b4.zip
Convert effective_cache_size to an integer, for better integration with
upcoming units feature.
-rw-r--r--doc/src/sgml/config.sgml4
-rw-r--r--src/backend/optimizer/path/costsize.c6
-rw-r--r--src/backend/utils/misc/guc.c24
-rw-r--r--src/include/optimizer/cost.h6
4 files changed, 20 insertions, 20 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index e967b235f36..45350ac7ae9 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.69 2006/07/25 03:51:21 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.70 2006/07/26 11:35:55 petere Exp $ -->
<chapter Id="runtime-config">
<title>Server Configuration</title>
@@ -1856,7 +1856,7 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Windows
</varlistentry>
<varlistentry id="guc-effective-cache-size" xreflabel="effective_cache_size">
- <term><varname>effective_cache_size</varname> (<type>floating point</type>)</term>
+ <term><varname>effective_cache_size</varname> (<type>integer</type>)</term>
<indexterm>
<primary><varname>effective_cache_size</> configuration parameter</primary>
</indexterm>
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index 14350a90f7a..5f5e9ec3721 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -54,7 +54,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.163 2006/07/22 15:41:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.164 2006/07/26 11:35:56 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -92,7 +92,7 @@ double cpu_tuple_cost = DEFAULT_CPU_TUPLE_COST;
double cpu_index_tuple_cost = DEFAULT_CPU_INDEX_TUPLE_COST;
double cpu_operator_cost = DEFAULT_CPU_OPERATOR_COST;
-double effective_cache_size = DEFAULT_EFFECTIVE_CACHE_SIZE;
+int effective_cache_size = DEFAULT_EFFECTIVE_CACHE_SIZE;
Cost disable_cost = 100000000.0;
@@ -393,7 +393,7 @@ index_pages_fetched(double tuples_fetched, BlockNumber pages,
T = (pages > 1) ? (double) pages : 1.0;
/* b is pro-rated share of effective_cache_size */
- b = effective_cache_size * T / (T + (double) other_pages);
+ b = (double) effective_cache_size * T / (T + (double) other_pages);
/* force it positive and integral */
if (b <= 1.0)
b = 1.0;
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 400a267e704..cf38490d9e3 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.329 2006/07/25 03:51:21 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.330 2006/07/26 11:35:56 petere Exp $
*
*--------------------------------------------------------------------
*/
@@ -1579,6 +1579,17 @@ static struct config_int ConfigureNamesInt[] =
0, 0, INT_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, INT_MAX, NULL, NULL
+ },
+
/* End-of-list marker */
{
{NULL, 0, 0, NULL, NULL}, NULL, 0, 0, 0, NULL, NULL
@@ -1635,17 +1646,6 @@ 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.")
- },
- &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/include/optimizer/cost.h b/src/include/optimizer/cost.h
index fe8f7097e47..27928b89a53 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.77 2006/07/22 15:41:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.78 2006/07/26 11:35:56 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,7 +27,7 @@
#define DEFAULT_CPU_INDEX_TUPLE_COST 0.005
#define DEFAULT_CPU_OPERATOR_COST 0.0025
-#define DEFAULT_EFFECTIVE_CACHE_SIZE 1000.0 /* measured in pages */
+#define DEFAULT_EFFECTIVE_CACHE_SIZE 1000 /* measured in pages */
/*
@@ -41,7 +41,7 @@ extern DLLIMPORT double random_page_cost;
extern DLLIMPORT double cpu_tuple_cost;
extern DLLIMPORT double cpu_index_tuple_cost;
extern DLLIMPORT double cpu_operator_cost;
-extern DLLIMPORT double effective_cache_size;
+extern DLLIMPORT int effective_cache_size;
extern Cost disable_cost;
extern bool enable_seqscan;
extern bool enable_indexscan;