Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c023501

Browse files
committed
Improve VACUUM/ANALYZE BUFFER_USAGE_LIMIT docs
This addresses various deficiencies in the documentation for VACUUM and ANALYZE's BUFFER_USEAGE_LIMIT docs. Here we declare "size" in the syntax synopsis for VACUUM and ANALYZE's BUFFER_USAGE_LIMIT option and then define exactly what values can be specified for it in the section for that below. Also, fix the incorrect ordering of vacuumdb options both in the documents and in vacuumdb's --help output. These should be in alphabetical order. In passing also add the minimum/maximum range for the BUFFER_USAGE_LIMIT option. These will also serve as example values that can be modified and used. Reported-by: Peter Eisentraut Discussion: https://postgr.es/m/16845cb1-b228-e157-f293-5892bced9253@enterprisedb.com
1 parent 064eb89 commit c023501

File tree

4 files changed

+46
-18
lines changed

4 files changed

+46
-18
lines changed

doc/src/sgml/ref/analyze.sgml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
2828

2929
VERBOSE [ <replaceable class="parameter">boolean</replaceable> ]
3030
SKIP_LOCKED [ <replaceable class="parameter">boolean</replaceable> ]
31-
BUFFER_USAGE_LIMIT [ <replaceable class="parameter">string</replaceable> ]
31+
BUFFER_USAGE_LIMIT [ <replaceable class="parameter">size</replaceable> ]
3232

3333
<phrase>and <replaceable class="parameter">table_and_columns</replaceable> is:</phrase>
3434

@@ -110,7 +110,8 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
110110
<xref linkend="guc-vacuum-buffer-usage-limit"/>. Higher settings can
111111
allow <command>ANALYZE</command> to run more quickly, but having too
112112
large a setting may cause too many other useful pages to be evicted from
113-
shared buffers.
113+
shared buffers. The minimum value is <literal>128 kB</literal> and the
114+
maximum value is <literal>16 GB</literal>.
114115
</para>
115116
</listitem>
116117
</varlistentry>
@@ -129,6 +130,19 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
129130
</listitem>
130131
</varlistentry>
131132

133+
<varlistentry>
134+
<term><replaceable class="parameter">size</replaceable></term>
135+
<listitem>
136+
<para>
137+
Specifies an amount of memory in kilobytes. Sizes may also be specified
138+
as a string containing the numerical size followed by any one of the
139+
following memory units: <literal>kB</literal> (kilobytes),
140+
<literal>MB</literal> (megabytes), <literal>GB</literal> (gigabytes), or
141+
<literal>TB</literal> (terabytes).
142+
</para>
143+
</listitem>
144+
</varlistentry>
145+
132146
<varlistentry>
133147
<term><replaceable class="parameter">table_name</replaceable></term>
134148
<listitem>

doc/src/sgml/ref/vacuum.sgml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet
3939
PARALLEL <replaceable class="parameter">integer</replaceable>
4040
SKIP_DATABASE_STATS [ <replaceable class="parameter">boolean</replaceable> ]
4141
ONLY_DATABASE_STATS [ <replaceable class="parameter">boolean</replaceable> ]
42-
BUFFER_USAGE_LIMIT [ <replaceable class="parameter">string</replaceable> ]
42+
BUFFER_USAGE_LIMIT [ <replaceable class="parameter">size</replaceable> ]
4343

4444
<phrase>and <replaceable class="parameter">table_and_columns</replaceable> is:</phrase>
4545

@@ -364,7 +364,8 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet
364364
<xref linkend="guc-vacuum-buffer-usage-limit"/>. Higher settings can
365365
allow <command>VACUUM</command> to run more quickly, but having too
366366
large a setting may cause too many other useful pages to be evicted from
367-
shared buffers.
367+
shared buffers. The minimum value is <literal>128 kB</literal> and the
368+
maximum value is <literal>16 GB</literal>.
368369
</para>
369370
</listitem>
370371
</varlistentry>
@@ -392,6 +393,19 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet
392393
</listitem>
393394
</varlistentry>
394395

396+
<varlistentry>
397+
<term><replaceable class="parameter">size</replaceable></term>
398+
<listitem>
399+
<para>
400+
Specifies an amount of memory in kilobytes. Sizes may also be specified
401+
as a string containing the numerical size followed by any one of the
402+
following memory units: <literal>kB</literal> (kilobytes),
403+
<literal>MB</literal> (megabytes), <literal>GB</literal> (gigabytes), or
404+
<literal>TB</literal> (terabytes).
405+
</para>
406+
</listitem>
407+
</varlistentry>
408+
395409
<varlistentry>
396410
<term><replaceable class="parameter">table_name</replaceable></term>
397411
<listitem>

doc/src/sgml/ref/vacuumdb.sgml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,19 @@ PostgreSQL documentation
121121
</listitem>
122122
</varlistentry>
123123

124+
<varlistentry>
125+
<term><option>--buffer-usage-limit <replaceable class="parameter">size</replaceable></option></term>
126+
<listitem>
127+
<para>
128+
Specifies the
129+
<glossterm linkend="glossary-buffer-access-strategy">Buffer Access Strategy</glossterm>
130+
ring buffer size for a given invocation of <application>vacuumdb</application>.
131+
This size is used to calculate the number of shared buffers which will
132+
be reused as part of this strategy. See <xref linkend="sql-vacuum"/>.
133+
</para>
134+
</listitem>
135+
</varlistentry>
136+
124137
<varlistentry>
125138
<term><option><optional>-d</optional> <replaceable class="parameter">dbname</replaceable></option></term>
126139
<term><option><optional>--dbname=</optional><replaceable class="parameter">dbname</replaceable></option></term>
@@ -278,19 +291,6 @@ PostgreSQL documentation
278291
</listitem>
279292
</varlistentry>
280293

281-
<varlistentry>
282-
<term><option>--buffer-usage-limit <replaceable class="parameter">buffer_usage_limit</replaceable></option></term>
283-
<listitem>
284-
<para>
285-
Specifies the
286-
<glossterm linkend="glossary-buffer-access-strategy">Buffer Access Strategy</glossterm>
287-
ring buffer size for a given invocation of <application>vacuumdb</application>.
288-
This size is used to calculate the number of shared buffers which will
289-
be reused as part of this strategy. See <xref linkend="sql-vacuum"/>.
290-
</para>
291-
</listitem>
292-
</varlistentry>
293-
294294
<varlistentry>
295295
<term><option>-n <replaceable class="parameter">schema</replaceable></option></term>
296296
<term><option>--schema=<replaceable class="parameter">schema</replaceable></option></term>

src/bin/scripts/vacuumdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ help(const char *progname)
11281128
printf(_(" %s [OPTION]... [DBNAME]\n"), progname);
11291129
printf(_("\nOptions:\n"));
11301130
printf(_(" -a, --all vacuum all databases\n"));
1131+
printf(_(" --buffer-usage-limit=SIZE size of ring buffer used for vacuum\n"));
11311132
printf(_(" -d, --dbname=DBNAME database to vacuum\n"));
11321133
printf(_(" --disable-page-skipping disable all page-skipping behavior\n"));
11331134
printf(_(" -e, --echo show the commands being sent to the server\n"));
@@ -1136,7 +1137,6 @@ help(const char *progname)
11361137
printf(_(" --force-index-cleanup always remove index entries that point to dead tuples\n"));
11371138
printf(_(" -j, --jobs=NUM use this many concurrent connections to vacuum\n"));
11381139
printf(_(" --min-mxid-age=MXID_AGE minimum multixact ID age of tables to vacuum\n"));
1139-
printf(_(" --buffer-usage-limit=BUFSIZE size of ring buffer used for vacuum\n"));
11401140
printf(_(" --min-xid-age=XID_AGE minimum transaction ID age of tables to vacuum\n"));
11411141
printf(_(" --no-index-cleanup don't remove index entries that point to dead tuples\n"));
11421142
printf(_(" --no-process-main skip the main relation\n"));

0 commit comments

Comments
 (0)