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.
This commit is contained in:
parent
ae3129fd03
commit
c969fed7ec
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.81 2001/09/20 14:20:27 petere Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.82 2001/09/21 03:32:35 tgl Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<Chapter Id="runtime">
|
<Chapter Id="runtime">
|
||||||
@ -780,6 +780,45 @@ env PGOPTIONS='-c geqo=off' psql
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>COLLECT_STARTCOLLECTOR</varname> (<type>boolean</type>)</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Controls whether the postmaster should start the statistics-collection
|
||||||
|
subprocess. This is on by default, but may be turned off if you
|
||||||
|
know you have no interest in collecting statistics. This option
|
||||||
|
can only be set at postmaster start.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>COLLECT_RESETONPMSTART</varname> (<type>boolean</type>)</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If on, collected statistics are zeroed out whenever the postmaster
|
||||||
|
is restarted. If off, statistics are accumulated across postmaster
|
||||||
|
restarts. The default is on. This option
|
||||||
|
can only be set at postmaster start.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>COLLECT_QUERYSTRING</varname> (<type>boolean</type>)</term>
|
||||||
|
<term><varname>COLLECT_BLOCKLEVEL</varname> (<type>boolean</type>)</term>
|
||||||
|
<term><varname>COLLECT_TUPLELEVEL</varname> (<type>boolean</type>)</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
These flags determine what information backends send to the statistics
|
||||||
|
collector process: current queries, block-level activity statistics,
|
||||||
|
or tuple-level activity statistics. All default to off. Enabling
|
||||||
|
statistics collection costs a small amount of time per query, but
|
||||||
|
is invaluable for debugging and performance tuning.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>DEBUG_ASSERTIONS</varname> (<type>boolean</type>)</term>
|
<term><varname>DEBUG_ASSERTIONS</varname> (<type>boolean</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
@ -1013,7 +1052,7 @@ env PGOPTIONS='-c geqo=off' psql
|
|||||||
<primary>transaction isolation level</primary>
|
<primary>transaction isolation level</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<term><varname>DEFAUL_TRANSACTION_ISOLATION</varname> (<type>string</type>)</term>
|
<term><varname>DEFAULT_TRANSACTION_ISOLATION</varname> (<type>string</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Each SQL transaction has an isolation level, which can be
|
Each SQL transaction has an isolation level, which can be
|
||||||
@ -1201,6 +1240,19 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>PASSWORD_ENCRYPTION</varname> (<type>boolean</type>)</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
When a password is specified in <command>CREATE USER</> or
|
||||||
|
<command>ALTER USER</> without writing either ENCRYPTED or
|
||||||
|
UNENCRYPTED, this flag determines whether the password is encrypted.
|
||||||
|
The default is off (do not encrypt the password), but this choice
|
||||||
|
may change in a future release.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>TRANSFORM_NULL_EQUALS</varname> (<type>boolean</type>)</term>
|
<term><varname>TRANSFORM_NULL_EQUALS</varname> (<type>boolean</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
@ -1285,7 +1337,7 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the amount of memory to be used by internal sorts
|
Specifies the amount of memory to be used by internal sorts
|
||||||
and hashes before resorting to temporary disk files. The value
|
and hashes before switching to temporary disk files. The value
|
||||||
is specified in kilobytes, and defaults to 512 kilobytes. Note
|
is specified in kilobytes, and defaults to 512 kilobytes. Note
|
||||||
that for a complex query, several sorts and/or hashes might be
|
that for a complex query, several sorts and/or hashes might be
|
||||||
running in parallel, and each one will be allowed to use as
|
running in parallel, and each one will be allowed to use as
|
||||||
@ -1403,6 +1455,19 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>VACUUM_MEM</varname> (<type>integer</type>)</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Specifies the maximum amount of memory to be used by
|
||||||
|
<command>VACUUM</command> to keep track of to-be-reclaimed tuples.
|
||||||
|
The value is specified in kilobytes, and defaults to 8192 kilobytes.
|
||||||
|
Larger settings may improve the speed of vacuuming large tables
|
||||||
|
that have many deleted tuples.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>VIRTUAL_HOST</varname> (<type>string</type>)</term>
|
<term><varname>VIRTUAL_HOST</varname> (<type>string</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* relations with finite memory space usage. To do that, we set upper bounds
|
* 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.
|
* 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.
|
* dead tuples. We initially allocate an array of TIDs of that size.
|
||||||
* If the array threatens to overflow, we suspend the heap scan phase
|
* If the array threatens to overflow, we suspend the heap scan phase
|
||||||
* and perform a pass of index cleanup and page compaction, then resume
|
* and perform a pass of index cleanup and page compaction, then resume
|
||||||
@ -31,7 +31,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* lazy_space_alloc - space allocation decisions for lazy vacuum
|
||||||
*
|
*
|
||||||
* See the comments at the head of this file for rationale.
|
* 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
|
static void
|
||||||
lazy_space_alloc(LVRelStats *vacrelstats, BlockNumber relblocks)
|
lazy_space_alloc(LVRelStats *vacrelstats, BlockNumber relblocks)
|
||||||
@ -874,8 +872,8 @@ lazy_space_alloc(LVRelStats *vacrelstats, BlockNumber relblocks)
|
|||||||
int maxtuples;
|
int maxtuples;
|
||||||
int maxpages;
|
int maxpages;
|
||||||
|
|
||||||
maxtuples = (int) ((SortMem * 1024L) / sizeof(ItemPointerData));
|
maxtuples = (int) ((VacuumMem * 1024L) / sizeof(ItemPointerData));
|
||||||
/* stay sane if small SortMem */
|
/* stay sane if small VacuumMem */
|
||||||
if (maxtuples < MAX_TUPLES_PER_PAGE)
|
if (maxtuples < MAX_TUPLES_PER_PAGE)
|
||||||
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,
|
* 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.
|
* In that case, just forget the last few tuples.
|
||||||
*/
|
*/
|
||||||
if (vacrelstats->num_dead_tuples < vacrelstats->max_dead_tuples)
|
if (vacrelstats->num_dead_tuples < vacrelstats->max_dead_tuples)
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* NOTES
|
||||||
* Globals used all over the place should be declared here and not
|
* Globals used all over the place should be declared here and not
|
||||||
@ -82,6 +82,7 @@ char FloatFormat[20] = "%f";
|
|||||||
bool enableFsync = true;
|
bool enableFsync = true;
|
||||||
bool allowSystemTableMods = false;
|
bool allowSystemTableMods = false;
|
||||||
int SortMem = 512;
|
int SortMem = 512;
|
||||||
|
int VacuumMem = 8192;
|
||||||
int NBuffers = DEF_NBUFFERS;
|
int NBuffers = DEF_NBUFFERS;
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Support for grand unified configuration scheme, including SET
|
* Support for grand unified configuration scheme, including SET
|
||||||
* command, configuration file, and command line options.
|
* 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
|
* Copyright 2000 by PostgreSQL Global Development Group
|
||||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||||
@ -176,12 +176,11 @@ struct config_string
|
|||||||
*
|
*
|
||||||
* 4. Add a record below.
|
* 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.
|
* 6. Add it to src/bin/psql/tab-complete.c, if it's a USERSET option.
|
||||||
*
|
|
||||||
* WHEN MAKING MODIFICATIONS, remember to update postgresql.conf.sample
|
|
||||||
*
|
*
|
||||||
|
* 7. Don't forget to document the option.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -298,6 +297,9 @@ static struct config_int
|
|||||||
{"sort_mem", PGC_USERSET, &SortMem,
|
{"sort_mem", PGC_USERSET, &SortMem,
|
||||||
512, 4*BLCKSZ/1024, INT_MAX, NULL, NULL},
|
512, 4*BLCKSZ/1024, INT_MAX, NULL, NULL},
|
||||||
|
|
||||||
|
{"vacuum_mem", PGC_USERSET, &VacuumMem,
|
||||||
|
8192, 1024, INT_MAX, NULL, NULL},
|
||||||
|
|
||||||
{"debug_level", PGC_USERSET, &DebugLvl,
|
{"debug_level", PGC_USERSET, &DebugLvl,
|
||||||
0, 0, 16, NULL, NULL},
|
0, 0, 16, NULL, NULL},
|
||||||
|
|
||||||
|
@ -53,7 +53,8 @@
|
|||||||
#
|
#
|
||||||
# Performance
|
# Performance
|
||||||
#
|
#
|
||||||
#sort_mem = 512
|
#sort_mem = 512 # min 32
|
||||||
|
#vacuum_mem = 8192 # min 1024
|
||||||
#fsync = true
|
#fsync = true
|
||||||
|
|
||||||
|
|
||||||
@ -173,10 +174,11 @@
|
|||||||
#
|
#
|
||||||
# Misc
|
# Misc
|
||||||
#
|
#
|
||||||
|
#dynamic_library_path = '$libdir'
|
||||||
#australian_timezones = false
|
#australian_timezones = false
|
||||||
#deadlock_timeout = 1000
|
#deadlock_timeout = 1000
|
||||||
#default_transaction_isolation = 'read committed'
|
#default_transaction_isolation = 'read committed'
|
||||||
#max_expr_depth = 10000 # min 10
|
#max_expr_depth = 10000 # min 10
|
||||||
#password_encryption = false
|
#password_encryption = false
|
||||||
#sql_inheritance = true
|
#sql_inheritance = true
|
||||||
|
#transform_null_equals = false
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2000 by PostgreSQL Global Development Group
|
* Copyright 2000 by PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.37 2001/09/07 01:24:18 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.38 2001/09/21 03:32:36 tgl Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
@ -226,8 +226,8 @@ psql_completion(char *text, int start, int end)
|
|||||||
"enable_nestloop",
|
"enable_nestloop",
|
||||||
"enable_mergejoin",
|
"enable_mergejoin",
|
||||||
"enable_hashjoin",
|
"enable_hashjoin",
|
||||||
"geqo",
|
|
||||||
"ksqo",
|
"ksqo",
|
||||||
|
"geqo",
|
||||||
"fsync",
|
"fsync",
|
||||||
"debug_assertions",
|
"debug_assertions",
|
||||||
"debug_print_query",
|
"debug_print_query",
|
||||||
@ -241,6 +241,9 @@ psql_completion(char *text, int start, int end)
|
|||||||
"show_query_stats",
|
"show_query_stats",
|
||||||
"trace_notify",
|
"trace_notify",
|
||||||
"sql_inheritance",
|
"sql_inheritance",
|
||||||
|
"australian_timezones",
|
||||||
|
"password_encryption",
|
||||||
|
"transform_null_equals",
|
||||||
|
|
||||||
"geqo_threshold",
|
"geqo_threshold",
|
||||||
"geqo_pool_size",
|
"geqo_pool_size",
|
||||||
@ -248,6 +251,7 @@ psql_completion(char *text, int start, int end)
|
|||||||
"geqo_generations",
|
"geqo_generations",
|
||||||
"geqo_random_seed",
|
"geqo_random_seed",
|
||||||
"sort_mem",
|
"sort_mem",
|
||||||
|
"vacuum_mem",
|
||||||
"debug_level",
|
"debug_level",
|
||||||
"max_expr_depth",
|
"max_expr_depth",
|
||||||
"commit_delay",
|
"commit_delay",
|
||||||
@ -259,6 +263,9 @@ psql_completion(char *text, int start, int end)
|
|||||||
"cpu_index_tuple_cost",
|
"cpu_index_tuple_cost",
|
||||||
"cpu_operator_cost",
|
"cpu_operator_cost",
|
||||||
"geqo_selection_bias",
|
"geqo_selection_bias",
|
||||||
|
|
||||||
|
"default_transaction_isolation",
|
||||||
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: miscadmin.h,v 1.90 2001/09/08 15:24:00 petere Exp $
|
* $Id: miscadmin.h,v 1.91 2001/09/21 03:32:36 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* some of the information in this file should be moved to
|
* some of the information in this file should be moved to
|
||||||
@ -170,6 +170,7 @@ extern char DateFormat[];
|
|||||||
extern bool enableFsync;
|
extern bool enableFsync;
|
||||||
extern bool allowSystemTableMods;
|
extern bool allowSystemTableMods;
|
||||||
extern int SortMem;
|
extern int SortMem;
|
||||||
|
extern int VacuumMem;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A few postmaster startup options are exported here so the
|
* A few postmaster startup options are exported here so the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user