Re: When manual analyze is needed - Mailing list pgsql-general

From Laurenz Albe
Subject Re: When manual analyze is needed
Date
Msg-id b7aeea8a2f84a11b330137bf8849a0fc1e88ffee.camel@cybertec.at
Whole thread Raw
In response to When manual analyze is needed  (veem v <veema0000@gmail.com>)
Responses Re: When manual analyze is needed  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: When manual analyze is needed  (veem v <veema0000@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Orphan files filling root partition after crash
Next
From: Laurenz Albe
Date:
Subject: Re: Guarantees/Semantics of pg_stats