pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY 3+ messages / 1 participants [nested] [flat]
* pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY @ 2020-11-01 12:26 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2020-11-01 12:26 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Preserve index data in pg_statistic across REINDEX CONCURRENTLY Statistics associated to an index got lost after running REINDEX CONCURRENTLY, while the non-concurrent case preserves these correctly. The concurrent and non-concurrent operations need to be consistent for the end-user, and missing statistics would force to wait for a new analyze to happen, which could take some time depending on the activity of the existing autovacuum workers. This issue is fixed by copying any existing entries in pg_statistic associated to the old index to the new one. Note that this copy is already done with the data of the index in the stats collector. Reported-by: Fabrízio de Royes Mello Author: Michael Paquier, Fabrízio de Royes Mello Reviewed-by: Justin Pryzby Discussion: https://postgr.es/m/CAFcNs+qpFPmiHd1oTXvcPdvAHicJDA9qBUSujgAhUMJyUMb+SA@mail.gmail.com Backpatch-through: 12 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b17ff07aa3eb142d2cde2ea00e4a4e8f63686f96 Modified Files -------------- src/backend/catalog/heap.c | 41 ++++++++++++++++++++++++++++++ src/backend/catalog/index.c | 3 +++ src/include/catalog/heap.h | 1 + src/test/regress/expected/create_index.out | 22 ++++++++++++++++ src/test/regress/sql/create_index.sql | 12 +++++++++ 5 files changed, 79 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY @ 2020-11-01 12:26 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2020-11-01 12:26 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Preserve index data in pg_statistic across REINDEX CONCURRENTLY Statistics associated to an index got lost after running REINDEX CONCURRENTLY, while the non-concurrent case preserves these correctly. The concurrent and non-concurrent operations need to be consistent for the end-user, and missing statistics would force to wait for a new analyze to happen, which could take some time depending on the activity of the existing autovacuum workers. This issue is fixed by copying any existing entries in pg_statistic associated to the old index to the new one. Note that this copy is already done with the data of the index in the stats collector. Reported-by: Fabrízio de Royes Mello Author: Michael Paquier, Fabrízio de Royes Mello Reviewed-by: Justin Pryzby Discussion: https://postgr.es/m/CAFcNs+qpFPmiHd1oTXvcPdvAHicJDA9qBUSujgAhUMJyUMb+SA@mail.gmail.com Backpatch-through: 12 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bb62df46bcaa109d5eb1907392034024dde0886e Modified Files -------------- src/backend/catalog/heap.c | 41 ++++++++++++++++++++++++++++++ src/backend/catalog/index.c | 3 +++ src/include/catalog/heap.h | 1 + src/test/regress/expected/create_index.out | 22 ++++++++++++++++ src/test/regress/sql/create_index.sql | 12 +++++++++ 5 files changed, 79 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY @ 2020-11-01 12:26 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2020-11-01 12:26 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Preserve index data in pg_statistic across REINDEX CONCURRENTLY Statistics associated to an index got lost after running REINDEX CONCURRENTLY, while the non-concurrent case preserves these correctly. The concurrent and non-concurrent operations need to be consistent for the end-user, and missing statistics would force to wait for a new analyze to happen, which could take some time depending on the activity of the existing autovacuum workers. This issue is fixed by copying any existing entries in pg_statistic associated to the old index to the new one. Note that this copy is already done with the data of the index in the stats collector. Reported-by: Fabrízio de Royes Mello Author: Michael Paquier, Fabrízio de Royes Mello Reviewed-by: Justin Pryzby Discussion: https://postgr.es/m/CAFcNs+qpFPmiHd1oTXvcPdvAHicJDA9qBUSujgAhUMJyUMb+SA@mail.gmail.com Backpatch-through: 12 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/41a033b5054e047cc67a92e17fbbe4accb658b3b Modified Files -------------- src/backend/catalog/heap.c | 41 ++++++++++++++++++++++++++++++ src/backend/catalog/index.c | 3 +++ src/include/catalog/heap.h | 1 + src/test/regress/expected/create_index.out | 22 ++++++++++++++++ src/test/regress/sql/create_index.sql | 12 +++++++++ 5 files changed, 79 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-11-01 12:26 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-11-01 12:26 pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY Michael Paquier <michael@paquier.xyz> 2020-11-01 12:26 pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY Michael Paquier <michael@paquier.xyz> 2020-11-01 12:26 pgsql: Preserve index data in pg_statistic 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