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

Commit a967878

Browse files
committed
Mention REINDEX CONCURRENTLY in documentation about index maintenance
The documentation includes a section about index maintenance and reindexing, mentioning a set of steps based on CREATE INDEX CONCURRENTLY and ALTER TABLE (for constraint dependencies) to emulate REINDEX CONCURRENTLY. Now that REINDEX CONCURRENTLY is supported, let's just directly mention it instead. Reported-by: Peter Geoghegan Author: Michael Paquier Reviewed-by: Peter Eisentraut, Tom Lane Discussion: https://postgr.es/m/CAH2-WzmEL168t6w29aKrKXtpq9-apcmp0HC7K-fKt6ZgLXV6Dg@mail.gmail.com
1 parent acb897b commit a967878

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

doc/src/sgml/maintenance.sgml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -869,19 +869,10 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
869869

870870
<para>
871871
<xref linkend="sql-reindex"/> can be used safely and easily in all cases.
872-
But since the command requires an exclusive table lock, it is
873-
often preferable to execute an index rebuild with a sequence of
874-
creation and replacement steps. Index types that support
875-
<xref linkend="sql-createindex"/> with the <literal>CONCURRENTLY</literal>
876-
option can instead be recreated that way. If that is successful and the
877-
resulting index is valid, the original index can then be replaced by
878-
the newly built one using a combination of <xref linkend="sql-alterindex"/>
879-
and <xref linkend="sql-dropindex"/>. When an index is used to enforce
880-
uniqueness or other constraints, <xref linkend="sql-altertable"/> might
881-
be necessary to swap the existing constraint with one enforced by
882-
the new index. Review this alternate multistep rebuild approach
883-
carefully before using it as there are limitations on which
884-
indexes can be reindexed this way, and errors must be handled.
872+
This command requires an <literal>ACCESS EXCLUSIVE</literal> lock by
873+
default, hence it is often preferable to execute it with its
874+
<literal>CONCURRENTLY</literal> option which requires only a
875+
<literal>SHARE UPDATE EXCLUSIVE</literal> lock.
885876
</para>
886877
</sect1>
887878

0 commit comments

Comments
 (0)