I did check and found it was the bloated size of pg_class which was slowing 
down the performance.

It got fixed by adding in routine maintenance task. Things are fine now.


However, I want to know how come pg_class  (system table) get bloated/affected.

What could be the possible ways, where i can look into.


Due to business impact auto vacuum is off.




Sent from Outlook<http://aka.ms/weboutlook>


________________________________
From: Kevin Grittner <kgri...@gmail.com>
Sent: Friday, November 18, 2016 3:49 AM
To: Alvaro Herrera
Cc: dhaval jaiswal; Adrian Klaver; David G. Johnston; 
pgsql-general@postgresql.org
Subject: Re: [GENERAL] pg_class (system) table increasing size.

On Thu, Nov 17, 2016 at 3:16 PM, Alvaro Herrera
<alvhe...@2ndquadrant.com> wrote:

> Looks like you lost the stat data awhile ago (probably due to a server
> crash, or pg_stats_reset()) and it never got updated.  I suggest doing
> "ANALZYE pg_class" to create initial stats; that might prompt autovacuum
> to vacuum the table.  If the bloat is excessive, vacuuming might take a
> very long time, in which case perhaps consider VACUUM FULL (but be very
> aware of its consequences first).
>
> I think it's likely that this has happened to other catalogs as well, so
> check the pg_stat_sys_tables view for other entries with all zeroes in
> the n_tup_* columns.

+1

Also, you may want to review your autovacuum settings to make sure
they are aggressive enough.  You didn't describe you machine, your
workload, or your vacuum regimen, but if it's a large machine you
would probably need to raise autovacuum_vacuum_cost limit.  And if
autovacuum somehow got turned *off* you are likely to have all
kinds of problems with bloat, and may need to schedule some down
time to get it cleaned up.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Reply via email to