When manual analyze is needed

From: veem v <veema0000(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: When manual analyze is needed
Date: 2024-03-03 20:03:54
Message-ID: CAB+=1TWsJHEfZmfUp_7KSt04dTJhAf4A3m9moiaJrS-hwCyq8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
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.

So is auto vacuum analyze is sufficient to make sure optimal stats and
unbloated table structure in place or should we do it manually based on the
type of tables like
for e.g.
if a table is having just insert only types and getting similar amount of
data throughout the day 24*7
VS
a table which is getting bulk data load once a day only
VS
a volatile table with truncate load kind of operation
VS
a table with heavy Update/deletes also happening along with inserts
throughout the day 24*7.

Will auto vacuum/analyze take care of all such tables, or we need to do it
manually in certain scenarios?
And if any suboptimal plan is taken by the optimizer for a specific query
suddenly, because of the missing stats , how to catch that. Basically, how
to get the old plan hash and get it compared with the current plan hash?

Regards
Veem

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2024-03-03 23:04:28 Re: Orphan files filling root partition after crash
Previous Message Christophe Pettus 2024-03-03 20:03:07 Re: How to add columns faster