From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support disabling index bypassing by VACUUM.
Date: Sat, 19 Jun 2021 03:04:25 +0000
Message-ID: <E1luRHV-0006sx-7n@gemulon.postgresql.org> (raw)
Support disabling index bypassing by VACUUM.
Generalize the INDEX_CLEANUP VACUUM parameter (and the corresponding
reloption): make it into a ternary style boolean parameter. It now
exposes a third option, "auto". The "auto" option (which is now the
default) enables the "bypass index vacuuming" optimization added by
commit 1e55e7d1.
"VACUUM (INDEX_CLEANUP TRUE)" is redefined to once again make VACUUM
simply do any required index vacuuming, regardless of how few dead
tuples are encountered during the first scan of the target heap relation
(unless there are exactly zero). This gives users a way of opting out
of the "bypass index vacuuming" optimization, if for whatever reason
that proves necessary. It is also expected to be used by PostgreSQL
developers as a testing option from time to time.
"VACUUM (INDEX_CLEANUP FALSE)" does the same thing as it always has: it
forcibly disables both index vacuuming and index cleanup. It's not
expected to be used much in PostgreSQL 14. The failsafe mechanism added
by commit 1e55e7d1 addresses the same problem in a simpler way.
INDEX_CLEANUP can now be thought of as a testing and compatibility
option.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-By: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/CAH2-WznrBoCST4_Gxh_G9hA8NzGUbeBGnOUC8FcXcrhqsv6OHQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3499df0dee8c4ea51d264a674df5b5e31991319a
Modified Files
--------------
doc/src/sgml/ref/create_table.sgml | 23 +++++---
doc/src/sgml/ref/vacuum.sgml | 57 +++++++++++++-----
doc/src/sgml/ref/vacuumdb.sgml | 15 +++++
src/backend/access/common/reloptions.c | 35 ++++++++---
src/backend/access/heap/vacuumlazy.c | 105 ++++++++++++++++++++-------------
src/backend/commands/vacuum.c | 75 ++++++++++++++++-------
src/backend/postmaster/autovacuum.c | 10 +++-
src/bin/psql/tab-complete.c | 4 +-
src/bin/scripts/vacuumdb.c | 65 ++++++++++++++++----
src/include/commands/vacuum.h | 25 ++++----
src/include/utils/rel.h | 10 +++-
src/test/regress/expected/vacuum.out | 8 ++-
src/test/regress/sql/vacuum.sql | 8 ++-
13 files changed, 313 insertions(+), 127 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: pg@bowt.ie
Subject: Re: pgsql: Support disabling index bypassing by VACUUM.
In-Reply-To: <E1luRHV-0006sx-7n@gemulon.postgresql.org>
References: <E1luRHV-0006sx-7n@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox