Skip to content

Commit b3d33bf

Browse files
committed
Document concurrent indexes waiting on each other
Because regular CREATE INDEX commands are independent, and there's no logical data dependency, it's not immediately obvious that transactions held by concurrent index builds on one table will block the second phase of concurrent index creation on an unrelated table, so document this caveat. Backpatch this all the way back. In branch master, mention that only some indexes are involved. Author: James Coleman <jtc331@gmail.com> Reviewed-by: David Johnston <david.g.johnston@gmail.com> Discussion: https://postgr.es/m/CAAaqYe994=PUrn8CJZ4UEo_S-FfRr_3ogERyhtdgHAb2WG_Ufg@mail.gmail.com
1 parent ab4cbb4 commit b3d33bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/src/sgml/ref/create_index.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,9 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
446446
wait for existing transactions that have modified the table to terminate.
447447
After the second scan, the index build must wait for any transactions
448448
that have a snapshot (see <xref linkend="mvcc">) predating the second
449-
scan to terminate. Then finally the index can be marked ready for use,
450-
and the <command>CREATE INDEX</> command terminates.
449+
scan to terminate, including transactions used by any phase of concurrent
450+
index builds on other tables. Then finally the index can be marked ready for use,
451+
and the <command>CREATE INDEX</command> command terminates.
451452
Even then, however, the index may not be immediately usable for queries:
452453
in the worst case, it cannot be used as long as transactions exist that
453454
predate the start of the index build.

0 commit comments

Comments
 (0)