From b910d7ea358b0134d170ebf4002248df25a5f244 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 8 May 2014 21:11:47 -0400 Subject: [PATCH] Increase the default value of effective_cache_size to 4GB. Per discussion, the old value of 128MB is ridiculously small on modern machines; in fact, it's not even any larger than the default value of shared_buffers, which it certainly should be. Increase to 4GB, which is unlikely to be any worse than the old default for anyone, and should be noticeably better for most. Eventually we might have an autotuning scheme for this setting, but the recent attempt crashed and burned, so for now just do this. --- doc/src/sgml/config.sgml | 4 ++-- doc/src/sgml/release-9.4.sgml | 22 +++++++++---------- src/backend/utils/misc/postgresql.conf.sample | 2 +- src/include/optimizer/cost.h | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index bc5a887044..d9e5985a16 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3194,8 +3194,8 @@ include 'filename' memory allocated by PostgreSQL, nor does it reserve kernel disk cache; it is used only for estimation purposes. The system also does not assume data remains in - the disk cache between queries. The default is 128 megabytes - (128MB). + the disk cache between queries. The default is 4 gigabytes + (4GB). diff --git a/doc/src/sgml/release-9.4.sgml b/doc/src/sgml/release-9.4.sgml index 4e4f017e43..21c6fc77f7 100644 --- a/doc/src/sgml/release-9.4.sgml +++ b/doc/src/sgml/release-9.4.sgml @@ -722,22 +722,22 @@ - Auto-tune effective_cache_size - to be four-times shared buffers (Bruce Momjian, Tom Lane) + Increase work_mem and maintenance_work_mem + defaults by four times (Bruce Momjian) + + + + The new defaults are 4MB and 64MB respectively. - Increase work_mem and maintenance_work_mem - defaults by four-times (Bruce Momjian) - - - - The new defaults are 4MB and 64MB respectively. + Increase the default setting of effective_cache_size + to 4GB (Bruce Momjian, Tom Lane) diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 61685f7c13..6dc0698efe 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -283,7 +283,7 @@ #cpu_tuple_cost = 0.01 # same scale as above #cpu_index_tuple_cost = 0.005 # same scale as above #cpu_operator_cost = 0.0025 # same scale as above -#effective_cache_size = 128MB +#effective_cache_size = 4GB # - Genetic Query Optimizer - diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h index 3c3c63ae10..75e2afb1e2 100644 --- a/src/include/optimizer/cost.h +++ b/src/include/optimizer/cost.h @@ -27,7 +27,7 @@ #define DEFAULT_CPU_INDEX_TUPLE_COST 0.005 #define DEFAULT_CPU_OPERATOR_COST 0.0025 -#define DEFAULT_EFFECTIVE_CACHE_SIZE 16384 /* measured in pages */ +#define DEFAULT_EFFECTIVE_CACHE_SIZE 524288 /* measured in pages */ typedef enum {