Re: reclaiming disk space after major updates

From: Dan Harris <fbsd(at)drivefaster(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: reclaiming disk space after major updates
Date: 2007-06-07 21:26:56
Message-ID: 46687820.9000604@drivefaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

Andrew Sullivan wrote:
> 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.

They don't always have to be in a single transaction, that's a good idea to
break it up and vacuum in between, I'll consider that. Thanks

>
> 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.

I thought of this, but it seems to break other application logic that feeds a
steady streams of inserts into the tables.

Thanks again for your thoughts. I guess I'll just have to work around this
problem in application logic.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message jbar 2007-06-08 00:12:58 problems installing postgresql 8.0 on Mac OS 10.3.9
Previous Message Simon Riggs 2007-06-07 21:23:06 Re: [ADMIN] Attempt to re-archive existing WAL logsafterrestoringfrom backup

Browse pgsql-performance by date

  From Date Subject
Next Message Craig James 2007-06-07 22:50:45 Re: Best way to delete unreferenced rows?
Previous Message Tyrrill, Ed 2007-06-07 20:02:55 Best way to delete unreferenced rows?