From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Rob Northcott <Rob.Northcott@compilator.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Keep needing to run manual analyze
Date: Thu, 07 Jan 2021 03:06:01 +0100
Message-ID: <ef41e377a76f44c6844634f58e8157c04a727c1b.camel@cybertec.at> (raw)
In-Reply-To: <AM8PR08MB5843DB9B35A9BCE8DC93E3479BD00@AM8PR08MB5843.eurprd08.prod.outlook.com>
References: <AM8PR08MB5843DB9B35A9BCE8DC93E3479BD00@AM8PR08MB5843.eurprd08.prod.outlook.com>
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 left at 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, Rob.Northcott@compilator.com
Subject: Re: Keep needing to run manual analyze
In-Reply-To: <ef41e377a76f44c6844634f58e8157c04a727c1b.camel@cybertec.at>
References: <AM8PR08MB5843DB9B35A9BCE8DC93E3479BD00@AM8PR08MB5843.eurprd08.prod.outlook.com> <ef41e377a76f44c6844634f58e8157c04a727c1b.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox