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

Commit a03feb9

Browse files
committed
Expand warnings on locks acquired by CREATE INDEX CONCURRENTLY
The previous wording wasn't explicit enough, which could misled readers into thinking that the locks acquired are more restricted in nature than they really are. The resulting optimism can be damaging to morale when confronted with reality, as has been observed in the field. Greg Smith
1 parent 2202891 commit a03feb9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/src/sgml/ref/create_index.sgml

+10-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,16 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
381381
<para>
382382
In a concurrent index build, the index is actually entered into the
383383
system catalogs in one transaction, then the two table scans occur in a
384-
second and third transaction.
384+
second and third transaction. All active transactions at the time the
385+
second table scan starts, not just ones that already involve the table,
386+
have the potential to block the concurrent index creation until they
387+
finish. When checking for transactions that could still use the original
388+
index, concurrent index creation advances through potentially interfering
389+
older transactions one at a time, obtaining shared locks on their virtual
390+
transaction identifiers to wait for them to complete.
391+
</para>
392+
393+
<para>
385394
If a problem arises while scanning the table, such as a
386395
uniqueness violation in a unique index, the <command>CREATE INDEX</>
387396
command will fail but leave behind an <quote>invalid</> index. This index

0 commit comments

Comments
 (0)