Re: Bloat and Slow Vacuum Time on Toast

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ken Caruso <ken(at)ipl31(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Bloat and Slow Vacuum Time on Toast
Date: 2011-07-20 03:12:26
Message-ID: 28552.1311131546@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ken Caruso <ken(at)ipl31(dot)net> writes:
> On Tue, Jul 19, 2011 at 2:26 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Ken Caruso <ken(at)ipl31(dot)net> writes:
>>> If I look at the total relation size using the following query:
>>> SELECT SUM(pg_relation_size(pg_class.oid)) FROM pg_class ;
>>> This says the total size is around 191GB.

>> What PG version?

> 9.0.4

OK, so you need to worry about alternate forks. Your query is the same
as

select sum(pg_relation_size(oid, 'main')) from pg_class;

I bet you'll find that the difference is accounted for by one of

select sum(pg_relation_size(oid, 'fsm')) from pg_class;
select sum(pg_relation_size(oid, 'vm')) from pg_class;

Drill down and see which table is responsible ...

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Cédric Villemain 2011-07-20 13:32:43 Re: 9.0.4 Data corruption issue
Previous Message Ken Caruso 2011-07-20 02:17:13 Re: Bloat and Slow Vacuum Time on Toast