pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-admin@postgresql.org
Subject: Re: reclaiming disk space after major updates
Date: Thu, 7 Jun 2007 15:20:25 -0400
Message-ID: <20070607192025.GO14087@phlogiston.dyndns.org> (raw)
In-Reply-To: <46672F7C.4020400@drivefaster.net>
References: <46672F7C.4020400@drivefaster.net>

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@crankycanuck.ca
Everything that happens in the world happens at some place.
		--Jane Jacobs 



view thread (6+ messages)  latest in thread

Message-ID: <20070607192025.GO14087@phlogiston.dyndns.org>
Permalink:  ../20070607192025.GO14087@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20070607192025.GO14087@phlogiston.dyndns.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: ajs@crankycanuck.ca, pgsql-admin@postgresql.org
  Subject: Re: reclaiming disk space after major updates
  In-Reply-To: <20070607192025.GO14087@phlogiston.dyndns.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox