Re: pg_class (system) table increasing size.

From: dhaval jaiswal <dhavallj(at)hotmail(dot)com>
To: Kevin Grittner <kgrittn(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_class (system) table increasing size.
Date: 2016-11-21 17:34:56
Message-ID: MA1PR01MB00396C8DB30C93942C1FF6F3DFB50@MA1PR01MB0039.INDPRD01.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 <kgrittn(at)gmail(dot)com>
Sent: Friday, November 18, 2016 3:49 AM
To: Alvaro Herrera
Cc: dhaval jaiswal; Adrian Klaver; David G. Johnston; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] pg_class (system) table increasing size.

On Thu, Nov 17, 2016 at 3:16 PM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2016-11-21 17:44:58 Re: pg_class (system) table increasing size.
Previous Message Adrian Klaver 2016-11-21 15:24:13 Re: Partial update on an postgres upsert violates constraint