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;
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;
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
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."),
#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 */
/*
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;