summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2018-05-10 13:31:47 +0300
committerTeodor Sigaev <teodor@sigaev.ru>2018-05-10 13:31:47 +0300
commit8e12f4a250d250a89153da2eb9b91c31bb80c483 (patch)
treec09c7e452cacd9dfc8ff2b8fd2fb436c577e1184 /doc
parentddc1f32ee5073503a396c7a4df32865205dd3970 (diff)
downloadpostgresql-8e12f4a250d250a89153da2eb9b91c31bb80c483.tar.gz
Various improvements of skipping index scan during vacuum technics
- Change vacuum_cleanup_index_scale_factor GUC to PGC_USERSET. vacuum_cleanup_index_scale_factor GUC was defined as PGC_SIGHUP. But this GUC affects not only autovacuum. So it might be useful to change it from user session in order to influence manually runned VACUUM. - Add missing tab-complete support for vacuum_cleanup_index_scale_factor reloption. - Fix condition for B-tree index cleanup. Zero value of vacuum_cleanup_index_scale_factor means that user wants B-tree index cleanup to be never skipped. - Documentation and comment improvements Authors: Justin Pryzby, Alexander Korotkov, Liudmila Mantrova Reviewed by: all authors and Robert Haas Discussion: https://www.postgresql.org/message-id/flat/20180502023025.GD7631%40telsasoft.com
Diffstat (limited to 'doc')
-rw-r--r--doc/src/sgml/config.sgml35
1 files changed, 27 insertions, 8 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index ffea744cb8..c4afd148c5 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1893,15 +1893,34 @@ include_dir 'conf.d'
</term>
<listitem>
<para>
- When no tuples were deleted from the heap, B-tree indexes might still
- be scanned during <command>VACUUM</command> cleanup stage by two
- reasons. The first reason is that B-tree index contains deleted pages
- which can be recycled during cleanup. The second reason is that B-tree
- index statistics is stalled. The criterion of stalled index statistics
- is number of inserted tuples since previous statistics collection
- is greater than <varname>vacuum_cleanup_index_scale_factor</varname>
- fraction of total number of heap tuples.
+ Specifies the fraction of the total number of heap tuples counted in
+ the previous statistics collection that can be inserted without
+ incurring an index scan at the <command>VACUUM</command> cleanup stage.
+ This setting currently applies to B-tree indexes only.
</para>
+
+ <para>
+ If no tuples were deleted from the heap, B-tree indexes are still
+ scanned at the <command>VACUUM</command> cleanup stage when at least one
+ of the following conditions is met: the index statistics are stale, or
+ the index contains deleted pages that can be recycled during cleanup.
+ Index statistics are considered to be stale if the number of newly
+ inserted tuples exceeds the <varname>vacuum_cleanup_index_scale_factor</varname>
+ fraction of the total number of heap tuples detected by the previous
+ statistics collection. The total number of heap tuples is stored in
+ the index meta-page. Note that the meta-page does not include this data
+ until <command>VACUUM</command> finds no dead tuples, so B-tree index
+ scan at the cleanup stage can only be skipped if the second and
+ subsequent <command>VACUUM</command> cycles detect no dead tuples.
+ </para>
+
+ <para>
+ The value can range from <literal>0</literal> to <literal>100</literal>.
+ When <varname>vacuum_cleanup_index_scale_factor</varname> is set to
+ <literal>0</literal>, index scans are never skipped during
+ <command>VACUUM</command> cleanup. The default value is <literal>0.1</literal>.
+ </para>
+
</listitem>
</varlistentry>
</variablelist>