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

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Tyler <tyhou13(at)gmx(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Column changes such as an increase in varchar size, can cause extremely slow queries, and postgres should run analyze automatically.
Date: 2024-11-01 09:03:08
Message-ID: CAApHDvobxCxJ4cQ3an7AWL59zo+p4T2cCECqDn=yReA4Me9Taw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 1 Nov 2024 at 19:32, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bastien Roucariès 2024-11-01 10:20:03 Re: Detection of hadware feature => please do not use signal
Previous Message Heikki Linnakangas 2024-11-01 08:36:46 Re: BUG #17284: Assert failed in SerialAdd() when the summarize_serial mode is engaged