aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-09-21 03:32:36 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-09-21 03:32:36 +0000
commitc969fed7ecd54be6aca27e68a58efb57b2753ba2 (patch)
tree7efb48f750db915cc576238b87b26304cd242848 /src/backend
parentae3129fd03928c1f5614370c79f1d69bd613f54b (diff)
downloadpostgresql-c969fed7ecd54be6aca27e68a58efb57b2753ba2.tar.gz
postgresql-c969fed7ecd54be6aca27e68a58efb57b2753ba2.zip
Give VACUUM its own GUC parameter for memory usage, rather than
piggybacking on SortMem. Add documentation for some recently-added GUC parameters that had so far escaped it.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/commands/vacuumlazy.c12
-rw-r--r--src/backend/utils/init/globals.c3
-rw-r--r--src/backend/utils/misc/guc.c12
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample6
4 files changed, 18 insertions, 15 deletions
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index 8351da5e7df..3685217fb79 100644
--- a/src/backend/commands/vacuumlazy.c
+++ b/src/backend/commands/vacuumlazy.c
@@ -10,7 +10,7 @@
* relations with finite memory space usage. To do that, we set upper bounds
* on the number of tuples and pages we will keep track of at once.
*
- * We are willing to use at most SortMem memory space to keep track of
+ * We are willing to use at most VacuumMem memory space to keep track of
* dead tuples. We initially allocate an array of TIDs of that size.
* If the array threatens to overflow, we suspend the heap scan phase
* and perform a pass of index cleanup and page compaction, then resume
@@ -31,7 +31,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v 1.6 2001/09/04 19:12:05 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v 1.7 2001/09/21 03:32:35 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -865,8 +865,6 @@ count_nondeletable_pages(Relation onerel, LVRelStats *vacrelstats)
* lazy_space_alloc - space allocation decisions for lazy vacuum
*
* See the comments at the head of this file for rationale.
- *
- * XXX Should we have our own GUC parameter, instead of using SortMem?
*/
static void
lazy_space_alloc(LVRelStats *vacrelstats, BlockNumber relblocks)
@@ -874,8 +872,8 @@ lazy_space_alloc(LVRelStats *vacrelstats, BlockNumber relblocks)
int maxtuples;
int maxpages;
- maxtuples = (int) ((SortMem * 1024L) / sizeof(ItemPointerData));
- /* stay sane if small SortMem */
+ maxtuples = (int) ((VacuumMem * 1024L) / sizeof(ItemPointerData));
+ /* stay sane if small VacuumMem */
if (maxtuples < MAX_TUPLES_PER_PAGE)
maxtuples = MAX_TUPLES_PER_PAGE;
@@ -910,7 +908,7 @@ lazy_record_dead_tuple(LVRelStats *vacrelstats,
{
/*
* The array shouldn't overflow under normal behavior,
- * but perhaps it could if we are given a really small SortMem.
+ * but perhaps it could if we are given a really small VacuumMem.
* In that case, just forget the last few tuples.
*/
if (vacrelstats->num_dead_tuples < vacrelstats->max_dead_tuples)
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
index 935340ea01d..3a5ddee7bbf 100644
--- a/src/backend/utils/init/globals.c
+++ b/src/backend/utils/init/globals.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.59 2001/08/25 18:52:42 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.60 2001/09/21 03:32:35 tgl Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
@@ -82,6 +82,7 @@ char FloatFormat[20] = "%f";
bool enableFsync = true;
bool allowSystemTableMods = false;
int SortMem = 512;
+int VacuumMem = 8192;
int NBuffers = DEF_NBUFFERS;
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index ebb7745347e..5a5dcac47a6 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -4,7 +4,7 @@
* Support for grand unified configuration scheme, including SET
* command, configuration file, and command line options.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.49 2001/09/20 14:20:27 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.50 2001/09/21 03:32:35 tgl Exp $
*
* Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
@@ -176,12 +176,11 @@ struct config_string
*
* 4. Add a record below.
*
- * 5. Add it to postgresql.conf.sample
+ * 5. Add it to src/backend/utils/misc/postgresql.conf.sample.
*
- * 6. Don't forget to document that option.
- *
- * WHEN MAKING MODIFICATIONS, remember to update postgresql.conf.sample
+ * 6. Add it to src/bin/psql/tab-complete.c, if it's a USERSET option.
*
+ * 7. Don't forget to document the option.
*/
@@ -298,6 +297,9 @@ static struct config_int
{"sort_mem", PGC_USERSET, &SortMem,
512, 4*BLCKSZ/1024, INT_MAX, NULL, NULL},
+ {"vacuum_mem", PGC_USERSET, &VacuumMem,
+ 8192, 1024, INT_MAX, NULL, NULL},
+
{"debug_level", PGC_USERSET, &DebugLvl,
0, 0, 16, NULL, NULL},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 8faf8304eba..c39e31d7483 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -53,7 +53,8 @@
#
# Performance
#
-#sort_mem = 512
+#sort_mem = 512 # min 32
+#vacuum_mem = 8192 # min 1024
#fsync = true
@@ -173,10 +174,11 @@
#
# Misc
#
+#dynamic_library_path = '$libdir'
#australian_timezones = false
#deadlock_timeout = 1000
#default_transaction_isolation = 'read committed'
#max_expr_depth = 10000 # min 10
#password_encryption = false
#sql_inheritance = true
-
+#transform_null_equals = false