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

Commit 0734b0e

Browse files
author
Amit Kapila
committed
Improve docs and error messages for parallel vacuum.
The error messages, docs, and one of the options were using 'parallel degree' to indicate parallelism used by vacuum command. We normally use 'parallel workers' at other places so change it for parallel vacuum accordingly. Author: Bharath Rupireddy Reviewed-by: Dilip Kumar, Amit Kapila Backpatch-through: 13 Discussion: https://postgr.es/m/CALj2ACWz=PYrrFXVsEKb9J1aiX4raA+UBe02hdRp_zqDkrWUiw@mail.gmail.com
1 parent 01e6f1a commit 0734b0e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

doc/src/sgml/ref/vacuumdb.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,11 @@ PostgreSQL documentation
275275
</varlistentry>
276276

277277
<varlistentry>
278-
<term><option>-P <replaceable class="parameter">parallel_degree</replaceable></option></term>
279-
<term><option>--parallel=<replaceable class="parameter">parallel_degree</replaceable></option></term>
278+
<term><option>-P <replaceable class="parameter">parallel_workers</replaceable></option></term>
279+
<term><option>--parallel=<replaceable class="parameter">parallel_workers</replaceable></option></term>
280280
<listitem>
281281
<para>
282-
Specify the parallel degree of <firstterm>parallel vacuum</firstterm>.
282+
Specify the number of parallel workers for <firstterm>parallel vacuum</firstterm>.
283283
This allows the vacuum to leverage multiple CPUs to process indexes.
284284
See <xref linkend="sql-vacuum"/>.
285285
</para>

src/backend/commands/vacuum.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel)
165165
if (nworkers < 0 || nworkers > MAX_PARALLEL_WORKER_LIMIT)
166166
ereport(ERROR,
167167
(errcode(ERRCODE_SYNTAX_ERROR),
168-
errmsg("parallel vacuum degree must be between 0 and %d",
168+
errmsg("parallel workers for vacuum must be between 0 and %d",
169169
MAX_PARALLEL_WORKER_LIMIT),
170170
parser_errposition(pstate, opt->location)));
171171

src/bin/scripts/vacuumdb.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ main(int argc, char *argv[])
200200
vacopts.parallel_workers = atoi(optarg);
201201
if (vacopts.parallel_workers < 0)
202202
{
203-
pg_log_error("parallel vacuum degree must be a non-negative integer");
203+
pg_log_error("parallel workers for vacuum must be greater than or equal to zero");
204204
exit(1);
205205
}
206206
break;
@@ -1000,7 +1000,7 @@ help(const char *progname)
10001000
printf(_(" --no-index-cleanup don't remove index entries that point to dead tuples\n"));
10011001
printf(_(" --no-process-toast skip the TOAST table associated with the table to vacuum\n"));
10021002
printf(_(" --no-truncate don't truncate empty pages at the end of the table\n"));
1003-
printf(_(" -P, --parallel=PARALLEL_DEGREE use this many background workers for vacuum, if available\n"));
1003+
printf(_(" -P, --parallel=PARALLEL_WORKERS use this many background workers for vacuum, if available\n"));
10041004
printf(_(" -q, --quiet don't write any messages\n"));
10051005
printf(_(" --skip-locked skip relations that cannot be immediately locked\n"));
10061006
printf(_(" -t, --table='TABLE[(COLUMNS)]' vacuum specific table(s) only\n"));

src/test/regress/expected/vacuum.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ VACUUM (PARALLEL 2) pvactst;
110110
UPDATE pvactst SET i = i WHERE i < 1000;
111111
VACUUM (PARALLEL 0) pvactst; -- disable parallel vacuum
112112
VACUUM (PARALLEL -1) pvactst; -- error
113-
ERROR: parallel vacuum degree must be between 0 and 1024
113+
ERROR: parallel workers for vacuum must be between 0 and 1024
114114
LINE 1: VACUUM (PARALLEL -1) pvactst;
115115
^
116116
VACUUM (PARALLEL 2, INDEX_CLEANUP FALSE) pvactst;

0 commit comments

Comments
 (0)