Document concurrent indexes waiting on each other
authorAlvaro Herrera
Mon, 30 Nov 2020 21:24:55 +0000 (18:24 -0300)
committerAlvaro Herrera
Mon, 30 Nov 2020 21:24:55 +0000 (18:24 -0300)
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 
Reviewed-by: David Johnston
Discussion: https://postgr.es/m/CAAaqYe994=PUrn8CJZ4UEo_S-FfRr_3ogERyhtdgHAb2WG_Ufg@mail.gmail.com

doc/src/sgml/ref/create_index.sgml

index bd69fb95ec5d10a463992b1fb81676b0df6fe3bf..2b41af48a7e23b94b05de020d12ad04536e85c27 100644 (file)
@@ -600,7 +600,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] 
     wait for existing transactions that have modified the table to terminate.
     After the second scan, the index build must wait for any transactions
     that have a snapshot (see ) predating the second
-    scan to terminate.  Then finally the index can be marked ready for use,
+    scan to terminate, including transactions used by any phase of concurrent
+    index builds on other tables.  Then finally the index can be marked ready for use,
     and the CREATE INDEX command terminates.
     Even then, however, the index may not be immediately usable for queries:
     in the worst case, it cannot be used as long as transactions exist that