Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ab892c

Browse files
committed
Add support for --jobs in reindexdb
When doing a schema-level or a database-level operation, a list ofrelations to build is created which gets processed in parallel usingmultiple connections, based on the recent refactoring for parallel slotsin src/bin/scripts/. System catalogs are processed first in aserialized fashion to prevent deadlocks, followed by the rest done inparallel.This new option is not compatible with --system as reindexing systemcatalogs in parallel can lead to deadlocks, and with --index as there isno conflict handling for indexes rebuilt in parallel depending in thesame relation.Author: Julien RouhaudReviewed-by: Sergei Kornilov, Michael PaquierDiscussion:https://postgr.es/m/CAOBaU_YrnH_Jqo46NhaJ7uRBiWWEcS40VNRQxgFbqYo9kApUsg@mail.gmail.com
1 parent4552c0f commit5ab892c

File tree

4 files changed

+432
-53
lines changed

4 files changed

+432
-53
lines changed

‎doc/src/sgml/ref/reindexdb.sgml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,29 @@ PostgreSQL documentation
166166
</listitem>
167167
</varlistentry>
168168

169+
<varlistentry>
170+
<term><option>-j <replaceable class="parameter">njobs</replaceable></option></term>
171+
<term><option>--jobs=<replaceable class="parameter">njobs</replaceable></option></term>
172+
<listitem>
173+
<para>
174+
Execute the reindex commands in parallel by running
175+
<replaceable class="parameter">njobs</replaceable>
176+
commands simultaneously. This option reduces the time of the
177+
processing but it also increases the load on the database server.
178+
</para>
179+
<para>
180+
<application>reindexdb</application> will open
181+
<replaceable class="parameter">njobs</replaceable> connections to the
182+
database, so make sure your <xref linkend="guc-max-connections"/>
183+
setting is high enough to accommodate all connections.
184+
</para>
185+
<para>
186+
Note that this option is incompatible with the <option>--index</option>
187+
and <option>--system</option> options.
188+
</para>
189+
</listitem>
190+
</varlistentry>
191+
169192
<varlistentry>
170193
<term><option>-q</option></term>
171194
<term><option>--quiet</option></term>

‎src/bin/scripts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dropdb: dropdb.o common.o $(WIN32RES) | submake-libpq submake-libpgport submake-
2929
dropuser: dropuser.o common.o$(WIN32RES) | submake-libpq submake-libpgport submake-libpgfeutils
3030
clusterdb: clusterdb.o common.o$(WIN32RES) | submake-libpq submake-libpgport submake-libpgfeutils
3131
vacuumdb: vacuumdb.o common.o scripts_parallel.o$(WIN32RES) | submake-libpq submake-libpgport submake-libpgfeutils
32-
reindexdb: reindexdb.o common.o$(WIN32RES) | submake-libpq submake-libpgport submake-libpgfeutils
32+
reindexdb: reindexdb.o common.oscripts_parallel.o$(WIN32RES) | submake-libpq submake-libpgport submake-libpgfeutils
3333
pg_isready: pg_isready.o common.o$(WIN32RES) | submake-libpq submake-libpgport submake-libpgfeutils
3434

3535
install: all installdirs

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp