pgsql: Ignore BRIN indexes when checking for HOT udpates

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Ignore BRIN indexes when checking for HOT udpates
Date: 2021-11-30 19:04:47
Message-ID: E1ms8Qp-0007re-JL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Ignore BRIN indexes when checking for HOT udpates

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 also removes rd_indexattr list, and replaces it with rd_attrsvalid
flag. The list was not used anywhere, and a simple flag is sufficient.

Patch by Josef Simanek, various fixes and improvements by me.

Author: Josef Simanek
Reviewed-by: Tomas Vondra, Alvaro Herrera
Discussion: https://postgr.es/m/CAFp7QwpMRGcDAQumN7onN9HjrJ3u4X3ZRXdGFT0K5G2JWvnbWg%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5753d4ee320b3f6fb2ff734667a1ce1d9d8615a1

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 | 50 ++++++++------
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 | 85 ++++++++++++++++++++++++
src/test/regress/sql/brin.sql | 63 ++++++++++++++++++
15 files changed, 202 insertions(+), 25 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2021-11-30 19:41:31 pgsql: vacuumlazy.c: fix remaining "dead tuple" references.
Previous Message Alvaro Herrera 2021-11-30 18:42:06 pgsql: Increase size of shared memory for pg_commit_ts

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-11-30 19:11:03 Re: [PATCH] Don't block HOT update by BRIN index
Previous Message Jacob Champion 2021-11-30 19:03:54 Re: Support for NSS as a libpq TLS backend