pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY 3+ messages / 1 participants [nested] [flat]
* pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY @ 2021-02-10 04:10 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2021-02-10 04:10 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY @ 2021-02-10 04:10 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2021-02-10 04:10 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8493831385814c4f22b1d5b5d8a9227a2eb82712 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(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY @ 2021-02-10 04:10 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2021-02-10 04:10 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/85edb1f2615d48bdc2420b00c55286eef3a3244c 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(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-02-10 04:10 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-02-10 04:10 pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY Michael Paquier <michael@paquier.xyz> 2021-02-10 04:10 pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY Michael Paquier <michael@paquier.xyz> 2021-02-10 04:10 pgsql: Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY Michael Paquier <michael@paquier.xyz>
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