On Wed, 6 Aug 2025 13:20:18 +0900
Fujii Masao <[email protected]> wrote:
> On Tue, Aug 5, 2025 at 10:09 AM Yugo Nagata <[email protected]> wrote:
> > Thank you for looking at it. I overlooked that virtual generated columns
> > don't have statistics currently (I'm working on this at [1], though).
> >
> > Your suggestion makes sense, so I've attached an updated patch.
> > I also mentioned virtual generated column in the description
> > of SET DATA TYPE.
> Thanks for updating the patch!
>
> As for back-patching, ANALYZE recommendation for SET EXPRESSION should
> be back-patched to v17, where that feature was introduced? Similarly,
> the note about virtual generated columns should go into v18,
> since that's when they were added?
Yes. I believe the back-patching would be better to both v17 and v18.
I've attached a patch for v17.
Regards,
Yugo Nagata
--
Yugo Nagata <[email protected]>
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 896a7e7baaf..029ddb391ec 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -265,6 +265,12 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
in the column is rewritten and all the future changes will apply the new
generation expression.
</para>
+
+ <para>
+ When this form is used, the column's statistics are removed,
+ so running <link linkend="sql-analyze"><command>ANALYZE</command></link>
+ on the table afterwards is recommended.
+ </para>
</listitem>
</varlistentry>