From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Revert changes in HOT handling of BRIN indexes
Date: Thu, 16 Jun 2022 13:03:56 +0000
Message-ID: <E1o1pAC-000Klk-2t@gemulon.postgresql.org> (raw)
Revert changes in HOT handling of BRIN indexes
This reverts commits 5753d4ee32 and fe60b67250 that modified HOT to
ignore BRIN indexes. The commit message for 5753d4ee32 claims that:
When determining whether an index update may be skipped by using
HOT, we can ignore attributes indexed only by BRIN indexes. There
are no index pointers to individual tuples in BRIN, and the page
range summary will be updated anyway as it relies on visibility
info.
This is partially incorrect - it's true BRIN indexes don't point to
individual tuples, so HOT chains are not an issue, but the visibitlity
info is not sufficient to keep the index up to date. This can easily
result in corrupted indexes, as demonstrated in the hackers thread.
This does not mean relaxing the HOT restrictions for BRIN is a lost
cause, but it needs to handle the two aspects (allowing HOT chains and
updating the page range summaries) as separate. But that requires a
major changes, and it's too late for that in the current dev cycle.
Reported-by: Tomas Vondra
Discussion: https://postgr.es/m/05ebcb44-f383-86e3-4f31-0a97a55634cf@enterprisedb.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/e3fcca0d0d2414f3a50d6fd40eddf48b7df81475
Modified Files
--------------
doc/src/sgml/indexam.sgml | 11 --
src/backend/access/brin/brin.c | 1 -
src/backend/access/gin/ginutil.c | 1 -
src/backend/access/gist/gist.c | 1 -
src/backend/access/hash/hash.c | 1 -
src/backend/access/heap/heapam.c | 2 +-
src/backend/access/nbtree/nbtree.c | 1 -
src/backend/access/spgist/spgutils.c | 1 -
src/backend/utils/cache/relcache.c | 53 +++--
src/include/access/amapi.h | 2 -
src/include/utils/rel.h | 3 +-
src/include/utils/relcache.h | 4 +-
src/test/modules/dummy_index_am/dummy_index_am.c | 1 -
src/test/regress/expected/brin.out | 58 ------
src/test/regress/expected/stats.out | 242 -----------------------
src/test/regress/sql/brin.sql | 36 ----
src/test/regress/sql/stats.sql | 111 -----------
17 files changed, 27 insertions(+), 502 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: tomas.vondra@postgresql.org
Subject: Re: pgsql: Revert changes in HOT handling of BRIN indexes
In-Reply-To: <E1o1pAC-000Klk-2t@gemulon.postgresql.org>
References: <E1o1pAC-000Klk-2t@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