diff options
| author | Michael Paquier <michael@paquier.xyz> | 2021-04-01 15:28:45 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2021-04-01 15:28:45 +0900 |
| commit | 876ecfba4d829f6d6c70ac4aa5f05b03269fbd95 (patch) | |
| tree | 5a437b1fce7e1c02745fd844c0f5b81712540025 /doc/src/sgml/ref | |
| parent | 89e383b30a94d1fb1ebfd63131433a93bcf47625 (diff) | |
doc: Clarify use of ACCESS EXCLUSIVE lock in various sections
Some sections of the documentation used "exclusive lock" to describe
that an ACCESS EXCLUSIVE lock is taken during a given operation. This
can be confusing to the reader as ACCESS SHARE is allowed with an
EXCLUSIVE lock is used, but that would not be the case with what is
described on those parts of the documentation.
Author: Greg Rychlewski
Discussion: https://postgr.es/m/CAKemG7VptD=7fNWckFMsMVZL_zzvgDO6v2yVmQ+ZiBfc_06kCQ@mail.gmail.com
Backpatch-through: 9.6
Diffstat (limited to 'doc/src/sgml/ref')
| -rw-r--r-- | doc/src/sgml/ref/drop_index.sgml | 7 | ||||
| -rw-r--r-- | doc/src/sgml/ref/reindex.sgml | 17 | ||||
| -rw-r--r-- | doc/src/sgml/ref/vacuum.sgml | 4 |
3 files changed, 15 insertions, 13 deletions
diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml index b6d2c2014f2..aabc85e2300 100644 --- a/doc/src/sgml/ref/drop_index.sgml +++ b/doc/src/sgml/ref/drop_index.sgml @@ -45,9 +45,10 @@ DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] <replaceable class="parameter">name</r <para> Drop the index without locking out concurrent selects, inserts, updates, and deletes on the index's table. A normal <command>DROP INDEX</command> - acquires an exclusive lock on the table, blocking other accesses until the - index drop can be completed. With this option, the command instead - waits until conflicting transactions have completed. + acquires an <literal>ACCESS EXCLUSIVE</literal> lock on the table, + blocking other accesses until the index drop can be completed. With + this option, the command instead waits until conflicting transactions + have completed. </para> <para> There are several caveats to be aware of when using this option. diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml index ef0e576d1ec..49e469d4617 100644 --- a/doc/src/sgml/ref/reindex.sgml +++ b/doc/src/sgml/ref/reindex.sgml @@ -235,14 +235,15 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN <command>REINDEX</command> is similar to a drop and recreate of the index in that the index contents are rebuilt from scratch. However, the locking considerations are rather different. <command>REINDEX</command> locks out writes - but not reads of the index's parent table. It also takes an exclusive lock - on the specific index being processed, which will block reads that attempt - to use that index. In contrast, <command>DROP INDEX</command> momentarily takes - an exclusive lock on the parent table, blocking both writes and reads. The - subsequent <command>CREATE INDEX</command> locks out writes but not reads; since - the index is not there, no read will attempt to use it, meaning that there - will be no blocking but reads might be forced into expensive sequential - scans. + but not reads of the index's parent table. It also takes an + <literal>ACCESS EXCLUSIVE</literal> lock on the specific index being processed, + which will block reads that attempt to use that index. In contrast, + <command>DROP INDEX</command> momentarily takes an + <literal>ACCESS EXCLUSIVE</literal> lock on the parent table, blocking both + writes and reads. The subsequent <command>CREATE INDEX</command> locks out + writes but not reads; since the index is not there, no read will attempt to + use it, meaning that there will be no blocking but reads might be forced + into expensive sequential scans. </para> <para> diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml index e232aba7c48..a83791735a9 100644 --- a/doc/src/sgml/ref/vacuum.sgml +++ b/doc/src/sgml/ref/vacuum.sgml @@ -82,8 +82,8 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet specify parallel workers as zero. <command>VACUUM FULL</command> rewrites the entire contents of the table into a new disk file with no extra space, allowing unused space to be returned to the operating system. This form is - much slower and requires an exclusive lock on each table while it is being - processed. + much slower and requires an <literal>ACCESS EXCLUSIVE</literal> lock on + each table while it is being processed. </para> <para> |
