1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Add --buffer-usage-limit option to vacuumdb

1cbbee033 added BUFFER_USAGE_LIMIT to the VACUUM and ANALYZE commands, so
here we permit that option to be specified in vacuumdb.

In passing, adjust the documents for vacuum_buffer_usage_limit and the
BUFFER_USAGE_LIMIT VACUUM option to mention "kB" rather than "KB".  Do the
same for the ERROR message in ExecVacuum() and
check_vacuum_buffer_usage_limit().  Without that we might tell a user that
the valid minimum value is 128 KB only to reject that because we accept
only "kB" and not "KB".

Also, add a small reminder comment in vacuum.h to try to trigger the
memory of anyone adding new fields to VacuumParams that they might want to
consider if vacuumdb needs to grow a new option too.

Author: Melanie Plageman
Reviewed-by: Justin Pryzby
Reviewed-by: David Rowley
Discussion: https://postgr.es/m/ZAzTg3iEnubscvbf@telsasoft.com
This commit is contained in:
David Rowley
2023-04-07 12:47:10 +12:00
parent 00d1e02be2
commit ae78cae3be
6 changed files with 48 additions and 6 deletions

View File

@ -2015,10 +2015,10 @@ include_dir 'conf.d'
used by the <command>VACUUM</command> and <command>ANALYZE</command>
commands. A setting of <literal>0</literal> will allow the operation
to use any number of <varname>shared_buffers</varname>. Otherwise
valid sizes range from <literal>128 KB</literal> to
valid sizes range from <literal>128 kB</literal> to
<literal>16 GB</literal>. If the specified size would exceed 1/8 the
size of <varname>shared_buffers</varname>, the size is silently capped
to that value. The default value is <literal>256 KB</literal>. If
to that value. The default value is <literal>256 kB</literal>. If
this value is specified without units, it is taken as kilobytes. This
parameter can be set at any time. It can be overridden for
<xref linkend="sql-vacuum"/> and <xref linkend="sql-analyze"/>

View File

@ -278,6 +278,19 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--buffer-usage-limit <replaceable class="parameter">buffer_usage_limit</replaceable></option></term>
<listitem>
<para>
Specifies the
<glossterm linkend="glossary-buffer-access-strategy">Buffer Access Strategy</glossterm>
ring buffer size for a given invocation of <application>vacuumdb</application>.
This size is used to calculate the number of shared buffers which will
be reused as part of this strategy. See <xref linkend="sql-vacuum"/>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-n <replaceable class="parameter">schema</replaceable></option></term>
<term><option>--schema=<replaceable class="parameter">schema</replaceable></option></term>