From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Ignore BRIN indexes when checking for HOT updates
Date: Mon, 20 Mar 2023 10:07:02 +0000
Message-ID: <E1peCPu-004SkQ-1A@gemulon.postgresql.org> (raw)
Ignore BRIN indexes when checking for HOT updates
When determining whether an index update may be skipped by using HOT, we
can ignore attributes indexed by block summarizing indexes without
references to individual tuples that need to be cleaned up.
A new type TU_UpdateIndexes provides a signal to the executor to
determine which indexes to update - no indexes, all indexes, or only the
summarizing indexes.
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.
This was originally committed as 5753d4ee32, but then got reverted by
e3fcca0d0d because of correctness issues.
Original patch by Josef Simanek, various fixes and improvements by Tomas
Vondra and me.
Authors: Matthias van de Meent, Josef Simanek, Tomas Vondra
Reviewed-by: Tomas Vondra, Alvaro Herrera
Discussion: https://postgr.es/m/05ebcb44-f383-86e3-4f31-0a97a55634cf@enterprisedb.com
Discussion: https://postgr.es/m/CAFp7QwpMRGcDAQumN7onN9HjrJ3u4X3ZRXdGFT0K5G2JWvnbWg%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/19d8e2308bc51ec4ab993ce90077342c915dd116
Modified Files
--------------
doc/src/sgml/indexam.sgml | 13 +++
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 | 48 +++++++++-
src/backend/access/heap/heapam_handler.c | 19 +++-
src/backend/access/nbtree/nbtree.c | 1 +
src/backend/access/spgist/spgutils.c | 1 +
src/backend/access/table/tableam.c | 2 +-
src/backend/catalog/index.c | 9 +-
src/backend/catalog/indexing.c | 35 +++++--
src/backend/commands/copyfrom.c | 5 +-
src/backend/commands/indexcmds.c | 10 +-
src/backend/executor/execIndexing.c | 37 ++++++--
src/backend/executor/execReplication.c | 9 +-
src/backend/executor/nodeModifyTable.c | 13 ++-
src/backend/nodes/makefuncs.c | 7 +-
src/backend/utils/cache/relcache.c | 70 ++++++++++----
src/include/access/amapi.h | 2 +
src/include/access/heapam.h | 5 +-
src/include/access/tableam.h | 22 ++++-
src/include/executor/executor.h | 3 +-
src/include/nodes/execnodes.h | 2 +
src/include/nodes/makefuncs.h | 4 +-
src/include/utils/rel.h | 4 +-
src/include/utils/relcache.h | 5 +-
src/test/modules/dummy_index_am/dummy_index_am.c | 1 +
src/test/regress/expected/stats.out | 111 +++++++++++++++++++++++
src/test/regress/sql/stats.sql | 82 +++++++++++++++++
30 files changed, 448 insertions(+), 76 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tomas.vondra@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Ignore BRIN indexes when checking for HOT updates
In-Reply-To: <E1peCPu-004SkQ-1A@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