pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.
3+ messages / 1 participants
[nested] [flat]

* pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.
@ 2025-08-06 07:49 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Fujii Masao @ 2025-08-06 07:49 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.

ALTER TABLE ... SET EXPRESSION AS removes statistics for the target column,
so running ANALYZE afterward is recommended. But this was previously not
documented, even though a similar recommendation exists for
ALTER TABLE ... SET DATA TYPE, which also clears the column's statistics.
This commit updates the documentation to include the ANALYZE recommendation
for SET EXPRESSION AS.

Since v18, virtual generated columns are supported, and these columns never
have statistics. Therefore, ANALYZE is not needed after SET DATA TYPE or
SET EXPRESSION AS when used on virtual generated columns. This commit also
updates the documentation to clarify that ANALYZE is unnecessary in such cases.

Back-patch the ANALYZE recommendation for SET EXPRESSION AS to v17
where the feature was introduced, and the note about virtual generated
columns to v18 where those columns were added.

Author: Yugo Nagata <nagata@sraoss.co.jp>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20250804151418.0cf365bd2855d606763443fe@sraoss.co.jp
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0b6aea03843dc75871b0490c6302a71a8fecb53d

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml | 11 +++++++++++
1 file changed, 11 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.
@ 2025-08-06 07:50 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Fujii Masao @ 2025-08-06 07:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.

ALTER TABLE ... SET EXPRESSION AS removes statistics for the target column,
so running ANALYZE afterward is recommended. But this was previously not
documented, even though a similar recommendation exists for
ALTER TABLE ... SET DATA TYPE, which also clears the column's statistics.
This commit updates the documentation to include the ANALYZE recommendation
for SET EXPRESSION AS.

Since v18, virtual generated columns are supported, and these columns never
have statistics. Therefore, ANALYZE is not needed after SET DATA TYPE or
SET EXPRESSION AS when used on virtual generated columns. This commit also
updates the documentation to clarify that ANALYZE is unnecessary in such cases.

Back-patch the ANALYZE recommendation for SET EXPRESSION AS to v17
where the feature was introduced, and the note about virtual generated
columns to v18 where those columns were added.

Author: Yugo Nagata <nagata@sraoss.co.jp>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20250804151418.0cf365bd2855d606763443fe@sraoss.co.jp
Backpatch-through: 17

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3e65e77f7666060630bae68624ec9be316a42ef0

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml | 11 +++++++++++
1 file changed, 11 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.
@ 2025-08-06 07:50 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Fujii Masao @ 2025-08-06 07:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.

ALTER TABLE ... SET EXPRESSION AS removes statistics for the target column,
so running ANALYZE afterward is recommended. But this was previously not
documented, even though a similar recommendation exists for
ALTER TABLE ... SET DATA TYPE, which also clears the column's statistics.
This commit updates the documentation to include the ANALYZE recommendation
for SET EXPRESSION AS.

Since v18, virtual generated columns are supported, and these columns never
have statistics. Therefore, ANALYZE is not needed after SET DATA TYPE or
SET EXPRESSION AS when used on virtual generated columns. This commit also
updates the documentation to clarify that ANALYZE is unnecessary in such cases.

Back-patch the ANALYZE recommendation for SET EXPRESSION AS to v17
where the feature was introduced, and the note about virtual generated
columns to v18 where those columns were added.

Author: Yugo Nagata <nagata@sraoss.co.jp>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20250804151418.0cf365bd2855d606763443fe@sraoss.co.jp
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/753177604b33df4cb9f32dd9db6f829ae733c41f

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml | 6 ++++++
1 file changed, 6 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-08-06 07:50 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-08-06 07:49 pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS. Fujii Masao <fujii@postgresql.org>
2025-08-06 07:50 pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS. Fujii Masao <fujii@postgresql.org>
2025-08-06 07:50 pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS. Fujii Masao <fujii@postgresql.org>

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