Commit 0307c09c authored by Bruce Momjian's avatar Bruce Momjian

Rename vacuum_cost_naptime to vacuum_cost_delay, with agreement from Jan.

parent bdf8ef69
<!--
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.272 2004/08/05 23:32:10 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.273 2004/08/06 04:15:07 momjian Exp $
-->
<Chapter Id="runtime">
......@@ -1074,7 +1074,7 @@ SET ENABLE_SEQSCAN TO OFF;
cost reaches a limit (specified by
<varname>vacuum_cost_limit</varname>), the process performing
the operation will sleep for a while (specified by
<varname>vacuum_cost_naptime</varname>). Then it will reset the
<varname>vacuum_cost_delay</varname>). Then it will reset the
counter and continue execution.
</para>
......@@ -1092,7 +1092,7 @@ SET ENABLE_SEQSCAN TO OFF;
<para>
This feature is disabled by default. To enable it, set the
<varname>vacuum_cost_naptime</varname> variable to a nonzero
<varname>vacuum_cost_delay</varname> variable to a nonzero
value.
</para>
......@@ -1143,8 +1143,8 @@ SET ENABLE_SEQSCAN TO OFF;
</listitem>
</varlistentry>
<varlistentry id="guc-vacuum-cost-naptime" xreflabel="vacuum_cost_naptime">
<term><varname>vacuum_cost_naptime</varname> (<type>integer</type>)</term>
<varlistentry id="guc-vacuum-cost-delay" xreflabel="vacuum_cost_delay">
<term><varname>vacuum_cost_delay</varname> (<type>integer</type>)</term>
<listitem>
<para>
The length of time, in milliseconds, that the process will nap
......@@ -1153,7 +1153,7 @@ SET ENABLE_SEQSCAN TO OFF;
delay feature. Positive values enable cost-based vacuuming.
Note however that on many systems, the effective resolution
of sleep delays is 10 milliseconds; setting
<varname>vacuum_cost_naptime</varname> to a value that is
<varname>vacuum_cost_delay</varname> to a value that is
not a multiple of 10 may have the same results as setting it
to the next higher multiple of 10.
</para>
......@@ -1168,10 +1168,10 @@ SET ENABLE_SEQSCAN TO OFF;
delays do not occur during such operations. Therefore it is
possible that the cost accumulates far higher than the specified
limit. To avoid uselessly long delays in such cases, the actual
naptime is calculated as <varname>vacuum_cost_naptime</varname> *
delay is calculated as <varname>vacuum_cost_delay</varname> *
<varname>accumulated_balance</varname> /
<varname>vacuum_cost_limit</varname> with a maximum of
<varname>vacuum_cost_naptime</varname> * 4.
<varname>vacuum_cost_delay</varname> * 4.
</para>
</note>
......
......@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.285 2004/07/31 00:45:31 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.286 2004/08/06 04:15:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -377,7 +377,7 @@ vacuum(VacuumStmt *vacstmt)
{
ListCell *cur;
VacuumCostActive = (VacuumCostNaptime > 0);
VacuumCostActive = (VacuumCostDelay > 0);
VacuumCostBalance = 0;
/*
......@@ -3373,9 +3373,9 @@ vacuum_delay_point(void)
{
int msec;
msec = VacuumCostNaptime * VacuumCostBalance / VacuumCostLimit;
if (msec > VacuumCostNaptime * 4)
msec = VacuumCostNaptime * 4;
msec = VacuumCostDelay * VacuumCostBalance / VacuumCostLimit;
if (msec > VacuumCostDelay * 4)
msec = VacuumCostDelay * 4;
pg_usleep(msec * 1000L);
......
......@@ -9167,7 +9167,7 @@ msgid "Vacuum cost amount available before napping."
msgstr ""
#: utils/misc/guc.c:1097
msgid "Vacuum cost naptime in milliseconds."
msgid "Vacuum cost delay in milliseconds."
msgstr ""
#: utils/misc/guc.c:1106
......
......@@ -9155,7 +9155,7 @@ msgid "Vacuum cost amount available before napping."
msgstr ""
#: utils/misc/guc.c:1062
msgid "Vacuum cost naptime in milliseconds."
msgid "Vacuum cost delay in milliseconds."
msgstr ""
#: utils/misc/guc.c:1071
......
......@@ -9875,7 +9875,7 @@ msgid "Vacuum cost amount available before napping."
msgstr ""
#: utils/misc/guc.c:1036
msgid "Vacuum cost naptime in milliseconds."
msgid "Vacuum cost delay in milliseconds."
msgstr ""
#: utils/misc/guc.c:1045
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.91 2004/06/18 06:13:54 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.92 2004/08/06 04:15:09 momjian Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
......@@ -96,7 +96,7 @@ int VacuumCostPageHit = 1; /* GUC parameters for vacuum */
int VacuumCostPageMiss = 10;
int VacuumCostPageDirty = 20;
int VacuumCostLimit = 200;
int VacuumCostNaptime = 0;
int VacuumCostDelay = 0;
int VacuumCostBalance = 0; /* working state for vacuum */
bool VacuumCostActive = false;
......@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.226 2004/08/05 23:32:12 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.227 2004/08/06 04:15:09 momjian Exp $
*
*--------------------------------------------------------------------
*/
......@@ -1041,11 +1041,11 @@ static struct config_int ConfigureNamesInt[] =
},
{
{"vacuum_cost_naptime", PGC_USERSET, RESOURCES,
gettext_noop("Vacuum cost naptime in milliseconds."),
{"vacuum_cost_delay", PGC_USERSET, RESOURCES,
gettext_noop("Vacuum cost delay in milliseconds."),
NULL
},
&VacuumCostNaptime,
&VacuumCostDelay,
0, 0, 1000, NULL, NULL
},
......
......@@ -74,7 +74,7 @@
#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
#vacuum_cost_delay = 50 # 0-1000 milliseconds
# - Background writer -
#bgwriter_delay = 200 # 10-5000 milliseconds
......
......@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.164 2004/08/01 17:32:20 tgl Exp $
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.165 2004/08/06 04:15:09 momjian Exp $
*
* NOTES
* some of the information in this file should be moved to other files.
......@@ -208,7 +208,7 @@ extern int VacuumCostPageHit;
extern int VacuumCostPageMiss;
extern int VacuumCostPageDirty;
extern int VacuumCostLimit;
extern int VacuumCostNaptime;
extern int VacuumCostDelay;
extern int VacuumCostBalance;
extern bool VacuumCostActive;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment