diff options
author | Michael Paquier <michael@paquier.xyz> | 2018-10-04 09:00:33 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2018-10-04 09:00:33 +0900 |
commit | 803b1301e8c9aac478abeec62824a5d09664ffff (patch) | |
tree | f4ade5601668689308c4acdd34fef6d6984dd54b /doc/src | |
parent | d173652797cf0cf456ac2c38eca898159a7c19fc (diff) |
Add option SKIP_LOCKED to VACUUM and ANALYZE
When specified, this option allows VACUUM to skip the work on a relation
if there is a conflicting lock on it when trying to open it at the
beginning of its processing.
Similarly to autovacuum, this comes with a couple of limitations while
the relation is processed which can cause the process to still block:
- when opening the relation indexes.
- when acquiring row samples for table inheritance trees, partition trees
or certain types of foreign tables, and that a lock is taken on some
leaves of such trees.
Author: Nathan Bossart
Reviewed-by: Michael Paquier, Andres Freund, Masahiko Sawada
Discussion: https://postgr.es/m/9EF7EBE4-720D-4CF1-9D0E-4403D7E92990@amazon.com
Discussion: https://postgr.es/m/20171201160907.27110.74730@wrigleys.postgresql.org
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/analyze.sgml | 19 | ||||
-rw-r--r-- | doc/src/sgml/ref/vacuum.sgml | 21 |
2 files changed, 40 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/analyze.sgml b/doc/src/sgml/ref/analyze.sgml index 10b3a9a6733..fea7f465215 100644 --- a/doc/src/sgml/ref/analyze.sgml +++ b/doc/src/sgml/ref/analyze.sgml @@ -27,6 +27,7 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea <phrase>where <replaceable class="parameter">option</replaceable> can be one of:</phrase> VERBOSE + SKIP_LOCKED <phrase>and <replaceable class="parameter">table_and_columns</replaceable> is:</phrase> @@ -77,6 +78,24 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea </varlistentry> <varlistentry> + <term><literal>SKIP_LOCKED</literal></term> + <listitem> + <para> + Specifies that <command>ANALYZE</command> should not wait for any + conflicting locks to be released when beginning work on a relation: + if a relation cannot be locked immediately without waiting, the relation + is skipped. Note that even with this option, <command>ANALYZE</command> + may still block when opening the relation's indexes or when acquiring + sample rows from partitions, table inheritance children, and some + types of foreign tables. Also, while <command>ANALYZE</command> + ordinarily processes all partitions of specified partitioned tables, + this option will cause <command>ANALYZE</command> to skip all + partitions if there is a conflicting lock on the partitioned table. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><replaceable class="parameter">table_name</replaceable></term> <listitem> <para> diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml index b760e8ede18..fd911f57766 100644 --- a/doc/src/sgml/ref/vacuum.sgml +++ b/doc/src/sgml/ref/vacuum.sgml @@ -31,6 +31,7 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet VERBOSE ANALYZE DISABLE_PAGE_SKIPPING + SKIP_LOCKED <phrase>and <replaceable class="parameter">table_and_columns</replaceable> is:</phrase> @@ -161,6 +162,26 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet </varlistentry> <varlistentry> + <term><literal>SKIP_LOCKED</literal></term> + <listitem> + <para> + Specifies that <command>VACUUM</command> should not wait for any + conflicting locks to be released when beginning work on a relation: + if a relation cannot be locked immediately without waiting, the relation + is skipped. Note that even with this option, + <command>VACUUM</command> may still block when opening the relation's + indexes. Additionally, <command>VACUUM ANALYZE</command> may still + block when acquiring sample rows from partitions, table inheritance + children, and some types of foreign tables. Also, while + <command>VACUUM</command> ordinarily processes all partitions of + specified partitioned tables, this option will cause + <command>VACUUM</command> to skip all partitions if there is a + conflicting lock on the partitioned table. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><replaceable class="parameter">table_name</replaceable></term> <listitem> <para> |