Re: Column changes such as an increase in varchar size, can cause extremely slow queries, and postgres should run analyze automatically. - Mailing list pgsql-bugs

From David Rowley
Subject Re: Column changes such as an increase in varchar size, can cause extremely slow queries, and postgres should run analyze automatically.
Date
Msg-id CAApHDvobxCxJ4cQ3an7AWL59zo+p4T2cCECqDn=yReA4Me9Taw@mail.gmail.com
Whole thread Raw
In response to Re: Column changes such as an increase in varchar size, can cause extremely slow queries, and postgres should run analyze automatically.  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #17284: Assert failed in SerialAdd() when the summarize_serial mode is engaged
Next
From: Tom Lane
Date:
Subject: Re: BUG #18682: Null grouping set with empty table returns a row contains null.