aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorJan Wieck <JanWieck@Yahoo.com>2004-02-06 19:36:18 +0000
committerJan Wieck <JanWieck@Yahoo.com>2004-02-06 19:36:18 +0000
commitf425b605f4e97a4571372b116a1ec81daf88dfc8 (patch)
tree65acd8532a650b76c988890df2ac05f867e9d87c /src/backend/utils
parent687d7cf3550f74bb09ddc0217025aad6fcc43a95 (diff)
downloadpostgresql-f425b605f4e97a4571372b116a1ec81daf88dfc8.tar.gz
postgresql-f425b605f4e97a4571372b116a1ec81daf88dfc8.zip
Cost based vacuum delay feature.
Jan
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/init/globals.c10
-rw-r--r--src/backend/utils/misc/guc.c47
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample6
3 files changed, 61 insertions, 2 deletions
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
index c170ae603df..f916d013d1c 100644
--- a/src/backend/utils/init/globals.c
+++ b/src/backend/utils/init/globals.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.82 2004/02/03 17:34:03 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.83 2004/02/06 19:36:18 wieck Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
@@ -81,3 +81,11 @@ bool allowSystemTableMods = false;
int work_mem = 1024;
int maintenance_work_mem = 16384;
int NBuffers = 1000;
+
+int VacuumCostPageHit = 1;
+int VacuumCostPageMiss = 10;
+int VacuumCostPageDirty = 20;
+int VacuumCostLimit = 200;
+int VacuumCostBalance = 0;
+int VacuumCostNaptime = 0;
+bool VacuumCostActive = false;
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index eb79ea2c627..7fe7c33cf8a 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.185 2004/02/04 01:24:53 wieck Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.186 2004/02/06 19:36:18 wieck Exp $
*
*--------------------------------------------------------------------
*/
@@ -1048,6 +1048,51 @@ static struct config_int ConfigureNamesInt[] =
},
{
+ {"vacuum_cost_page_hit", PGC_USERSET, RESOURCES,
+ gettext_noop("Vacuum cost for a page found in the buffer cache."),
+ NULL
+ },
+ &VacuumCostPageHit,
+ 1, 0, 10000, NULL, NULL
+ },
+
+ {
+ {"vacuum_cost_page_miss", PGC_USERSET, RESOURCES,
+ gettext_noop("Vacuum cost for a page not found in the buffer cache."),
+ NULL
+ },
+ &VacuumCostPageMiss,
+ 10, 0, 10000, NULL, NULL
+ },
+
+ {
+ {"vacuum_cost_page_dirty", PGC_USERSET, RESOURCES,
+ gettext_noop("Vacuum cost for a page dirtied by vacuum."),
+ NULL
+ },
+ &VacuumCostPageDirty,
+ 20, 0, 10000, NULL, NULL
+ },
+
+ {
+ {"vacuum_cost_limit", PGC_USERSET, RESOURCES,
+ gettext_noop("Vacuum cost amount available before napping."),
+ NULL
+ },
+ &VacuumCostLimit,
+ 200, 1, 10000, NULL, NULL
+ },
+
+ {
+ {"vacuum_cost_naptime", PGC_USERSET, RESOURCES,
+ gettext_noop("Vacuum cost naptime in milliseconds."),
+ NULL
+ },
+ &VacuumCostNaptime,
+ 0, 0, 1000, NULL, NULL
+ },
+
+ {
{"max_files_per_process", PGC_BACKEND, RESOURCES_KERNEL,
gettext_noop("Sets the maximum number of simultaneously open files for each server process."),
NULL
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index ad6f6bfcfef..ee7b47c04dc 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -60,6 +60,12 @@
#maintenance_work_mem = 16384 # min 1024, size in KB
#debug_shared_buffers = 0 # 0-600 seconds
+#vacuum_cost_page_hit = 1 # 0-10000 credits
+#vacuum_cost_page_miss = 10 # 0-10000 credits
+#vacuum_cost_page_dirty = 20 # 0-10000 credits
+#vacuum_cost_limit = 200 # 0-10000 credits
+#vacuum_cost_naptime = 50 # 0-1000 milliseconds
+
# - Background writer -
#bgwriter_delay = 200 # 10-5000 milliseconds
#bgwriter_percent = 1 # 0-100% of dirty buffers