On Fri, 1 Nov 2024 at 19:32, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> Would it be an option to clear pg_class.reltuples and pg_stat_all_tables.n_mod_since_analyze
> whenever the statistics for a table are cleared? Then autoanalyze would trigger after 50
> modifications.
I wondered about that too. I also wondered which cases we could have
ATExecAlterColumnType() not call RemoveStatistics(). If the table is
going to be rewritten, then we need to, but there must be plenty of
cases where we could forego removing the stats when there's no
rewrite.
David