From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY
Date: Wed, 10 Feb 2021 04:10:04 +0000
Message-ID: <E1l9gpI-0005LO-Ef@gemulon.postgresql.org> (raw)
Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY
For an index, attstattarget can be updated using ALTER INDEX SET
STATISTICS. This data was lost on the new index after REINDEX
CONCURRENTLY.
The update of this field is done when the old and new indexes are
swapped to make the fix back-patchable. Another approach we could look
after in the long-term is to change index_create() to pass the wanted
values of attstattarget when creating the new relation, but, as this
would cause an ABI breakage this can be done only on HEAD.
Reported-by: Ronan Dunklau
Author: Michael Paquier
Reviewed-by: Ronan Dunklau, Tomas Vondra
Discussion: https://postgr.es/m/16628084.uLZWGnKmhe@laptop-ronand
Backpatch-through: 12
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/bd12080980297dbc8ae926a3bd5b2ef9cc47932b
Modified Files
--------------
src/backend/catalog/index.c | 56 ++++++++++++++++++++++++++++++
src/backend/utils/cache/lsyscache.c | 27 ++++++++++++++
src/include/utils/lsyscache.h | 1 +
src/test/regress/expected/create_index.out | 15 ++++++++
src/test/regress/sql/create_index.sql | 8 +++++
5 files changed, 107 insertions(+)
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: michael@paquier.xyz
Subject: Re: pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY
In-Reply-To: <E1l9gpI-0005LO-Ef@gemulon.postgresql.org>
References: <E1l9gpI-0005LO-Ef@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