1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

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
This commit is contained in:
Tomas Vondra
2021-11-30 19:15:14 +01:00
parent 4c83e59e01
commit 5753d4ee32
15 changed files with 202 additions and 25 deletions

View File

@ -126,6 +126,8 @@ typedef struct IndexAmRoutine
bool amcaninclude;
/* does AM use maintenance_work_mem? */
bool amusemaintenanceworkmem;
/* does AM block HOT update? */
bool amhotblocking;
/* OR of parallel vacuum flags */
uint8 amparallelvacuumoptions;
/* type of data stored in index, or InvalidOid if variable */
@ -246,6 +248,15 @@ typedef struct IndexAmRoutine
null, independently of <structfield>amoptionalkey</structfield>.
</para>
<para>
The <structfield>amhotblocking</structfield> flag indicates whether the
access method blocks <acronym>HOT</acronym> when an indexed attribute is
updated. Access methods without pointers to individual tuples (like
<acronym>BRIN</acronym>) may allow <acronym>HOT</acronym> even in this
case. This does not apply to attributes referenced in index predicates,
an update of such attribute always disables <acronym>HOT</acronym>.
</para>
</sect1>
<sect1 id="index-functions">