Re: reclaiming disk space after major updates

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: reclaiming disk space after major updates
Date: 2007-06-07 19:20:25
Message-ID: 20070607192025.GO14087@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

On Wed, Jun 06, 2007 at 04:04:44PM -0600, Dan Harris wrote:
> of these operations or a full dump/reload. I do run VACUUM regularly, it's
> just that sometimes we need to go back and update a huge percentage of rows
> in a single batch due to changing customer requirements, leaving us with
> significant table bloat.

Do you need to update those rows in one transaction (i.e. is the
requirement that they all get updated such that the change only
becomes visible at once)? If not, you can do this in batches and
vacuum in between. Batch updates are the prime sucky area in
Postgres.

Another trick, if the table is otherwise mostly static, is to do the
updating in a copy of the table, and then use the transactional DDL
features of postgres to change the table names.

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
Everything that happens in the world happens at some place.
--Jane Jacobs

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Simon Riggs 2007-06-07 21:20:32 Re: Attempt to re-archive existing WAL logsafterrestoringfrom backup
Previous Message Andrew Sullivan 2007-06-07 17:46:39 Re: the right time to vacuum database?

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2007-06-07 19:26:58 Re: Getting Slow
Previous Message Alvaro Herrera 2007-06-07 18:58:54 Re: Getting Slow