Re: Keep needing to run manual analyze - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Keep needing to run manual analyze
Date
Msg-id ef41e377a76f44c6844634f58e8157c04a727c1b.camel@cybertec.at
Whole thread Raw
In response to Keep needing to run manual analyze  (Rob Northcott <Rob.Northcott@compilator.com>)
Responses RE: Keep needing to run manual analyze
List pgsql-general
On Wed, 2021-01-06 at 17:28 +0000, Rob Northcott wrote:
> We have an application that uses a Postgres database (currently 9.6).  All the autovacuum/analyze settings are just
leftat the defaults.
 
> We’ve had a few instances recently where users have complained of slow performance and running a manual Analyze
>  (not vacuum) on their database has resolved it.
> Should it be considered normal that this needs to be done manually periodically even when autovacuum is on?
> It’s not a very heavy application by a lot of people’s standards (it’s just a point-of-sale/stock-control system)
>  but there are a couple of hundred databases on the server, all in fairly constant use through the day.
> Is it possible that the autovacuum/analyze isn’t running for some reason?  If so, is there anything I
>  should look at to make it work better or should I just be looking at scheduling a manual vacuum/analyze
>  periodically on all databases?

That is not necessary.

You should figure out what tables need more frequent ANALYZE runs to get good execution plans
and tune autoanalyze for these tables, for example by reducing the scale factor for them.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: CROSSTAB( .. only one column has values... )
Next
From: Laurenz Albe
Date:
Subject: Re: SQL to query running transactions with subtransactions that exceeds 64