Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 673E89FB3BA for ; Wed, 6 Jun 2007 19:04:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 84441-07 for ; Wed, 6 Jun 2007 19:04:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from crestone.coronasolutions.com (crestone.coronasolutions.com [66.45.104.24]) by postgresql.org (Postfix) with ESMTP id E5CD89FB30A for ; Wed, 6 Jun 2007 19:04:52 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by crestone.coronasolutions.com (Postfix) with ESMTP id 93D1D644756; Wed, 6 Jun 2007 16:04:51 -0600 (MDT) Received: from crestone.coronasolutions.com ([127.0.0.1]) by localhost (crestone.coronasolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31173-02; Wed, 6 Jun 2007 16:04:50 -0600 (MDT) Received: from mac.local (c-67-176-68-155.hsd1.co.comcast.net [67.176.68.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by crestone.coronasolutions.com (Postfix) with ESMTP id 3F152644736 for ; Wed, 6 Jun 2007 16:04:50 -0600 (MDT) Message-ID: <46672F7C.4020400@drivefaster.net> Date: Wed, 06 Jun 2007 16:04:44 -0600 From: Dan Harris User-Agent: Thunderbird 2.0.0.0 (Macintosh/20070326) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: reclaiming disk space after major updates Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at coronasolutions.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200706/49 X-Sequence-Number: 25717 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 ).