pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: veem v <veema0000@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: When manual analyze is needed
Date: Mon, 04 Mar 2024 05:12:09 +0100
Message-ID: <b7aeea8a2f84a11b330137bf8849a0fc1e88ffee.camel@cybertec.at> (raw)
In-Reply-To: <CAB+=1TWsJHEfZmfUp_7KSt04dTJhAf4A3m9moiaJrS-hwCyq8Q@mail.gmail.com>
References: <CAB+=1TWsJHEfZmfUp_7KSt04dTJhAf4A3m9moiaJrS-hwCyq8Q@mail.gmail.com>

On Mon, 2024-03-04 at 01:33 +0530, veem v wrote:
> We see in one of the RDS postgres instances, from pg_stat_user_tables ,
> the auto vacuum and auto analyze happening on the tables without our
> manual intervention.

That's exactly the idea behind autovacuum.


> So is auto vacuum analyze is sufficient  to make sure optimal stats
> and unbloated table structure in place

Yes, it is sufficient.  If you have a busy database, you may have to
tune autovacuum to keep up.

The only things that require manual ANALYZE are

1. partitioned tables (autoanalyze will collect statistics on the
   partitions, but not the partitioned table itself)

2. after you create an index on an expression (otherwise you have to
   wait until autoanalyze runs to get statistics on the indexed
   expression)

Yours,
Laurenz Albe





view thread (9+ messages)  latest in thread

Message-ID: <b7aeea8a2f84a11b330137bf8849a0fc1e88ffee.camel@cybertec.at>
Permalink:  ../b7aeea8a2f84a11b330137bf8849a0fc1e88ffee.camel@cybertec.at/
Also on:    postgresql.org/message-id/b7aeea8a2f84a11b330137bf8849a0fc1e88ffee.camel@cybertec.at

 · 

reply

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, veema0000@gmail.com
  Subject: Re: When manual analyze is needed
  In-Reply-To: <b7aeea8a2f84a11b330137bf8849a0fc1e88ffee.camel@cybertec.at>
  References: <CAB+=1TWsJHEfZmfUp_7KSt04dTJhAf4A3m9moiaJrS-hwCyq8Q@mail.gmail.com> <b7aeea8a2f84a11b330137bf8849a0fc1e88ffee.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