pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan Harris <fbsd@drivefaster.net>
To: pgsql-admin@postgresql.org
Subject: reclaiming disk space after major updates
Date: Wed, 06 Jun 2007 16:04:44 -0600
Message-ID: <46672F7C.4020400@drivefaster.net> (raw)

Our usage pattern has recently left me with some very bloated database clusters. 
  I have, in the past, scheduled downtime to run VACUUM FULL and tried CLUSTER 
as well, followed by a REINDEX on all tables.  This does work, however the 
exclusive lock has become a real thorn in my side.  As our system grows, I am 
having trouble scheduling enough downtime for either 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.

So within the last few days my db cluster has grown from 290GB to 370GB and 
because of some other major data updates on my TO-DO list, I expect this to 
double and I'll be bumping up against my storage capacity.

The root of my question is due to my not understanding why the tables can't be 
in read-only mode while one of these is occurring?  Since most of our usage is 
OLAP, this really wouldn't matter much as long as the users could still query 
their data while it was running.  Is there some way I can allow users read-only 
access to this data while things are cleaned up in the background?  INSERTs can 
wait, SELECTs cannot.

So how do other people handle such a problem when downtime is heavily frowned 
upon?  We have 24/7 access ( but again, the users only read data ).



view thread (6+ messages)  latest in thread

Message-ID: <46672F7C.4020400@drivefaster.net>
Permalink:  ../46672F7C.4020400@drivefaster.net/
Also on:    postgresql.org/message-id/46672F7C.4020400@drivefaster.net

 · 

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: fbsd@drivefaster.net, pgsql-admin@postgresql.org
  Subject: Re: reclaiming disk space after major updates
  In-Reply-To: <46672F7C.4020400@drivefaster.net>

* 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