Re: table size is bigger than expected

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Jian Shi <jshi(at)unitrends(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: table size is bigger than expected
Date: 2011-08-04 23:47:19
Message-ID: 4E3B2F87.9010506@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 08/04/2011 11:56 AM, Jian Shi wrote:
>
> Hey,
>
> I'm a new user of PostgreSQL. I found one of my tables is taking
> unexpectedly large space:...
>
> I did vaccum, reindex, the size is still the same. Is there anything
> else that I can do?
>
>
Did you try CLUSTER? A basic vacuum only identifies space as reusable,
it doesn't actually shrink on-disk size.

If you have workloads that update or delete a small number of tuples per
transaction, the autovacuum process should keep things reasonably under
control. But if you run transactions that do bulk updates or deletes,
you may need to intervene. The CLUSTER statement will completely rewrite
and reindex your table (and will physically reorder the table based on
the selected index). Note: CLUSTER requires an exclusive lock on the table.

Cheers,
Steve

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Sumeet Jauhar 2011-08-05 02:33:31 Re: Suspected Postgres Datacorruption
Previous Message Mark Kirkwood 2011-08-04 22:32:34 Re: Need to tune for Heavy Write