Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 0CBEC9FC173 for ; Fri, 8 Jun 2007 12:11:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 42525-02 for ; Fri, 8 Jun 2007 12:11:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id F28DE9FC0DB for ; Fri, 8 Jun 2007 12:11:02 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1Hwg7C-0005a2-A9 for pgsql-performance@postgresql.org; Fri, 08 Jun 2007 11:11:02 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 0B1DA3F9E; Fri, 8 Jun 2007 11:10:57 -0400 (EDT) Date: Fri, 8 Jun 2007 11:10:57 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: [ADMIN] reclaiming disk space after major updates Message-ID: <20070608151057.GG17144@phlogiston.dyndns.org> References: <46672F7C.4020400@drivefaster.net> <20070607192025.GO14087@phlogiston.dyndns.org> <46687820.9000604@drivefaster.net> <20070608140354.GV17144@phlogiston.dyndns.org> <466967C4.70606@drivefaster.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <466967C4.70606@drivefaster.net> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/153 X-Sequence-Number: 25186 On Fri, Jun 08, 2007 at 08:29:24AM -0600, Dan Harris wrote: > > One more point in my original post.. For my own education, why does VACUUM > FULL prevent reads to a table when running (I'm sure there's a good > reason)? I can certainly understand blocking writes, but if I could still > read from it, I'd have no problems at all! It has to take an exclusive lock, because it actually moves the bits around on disk. Since your SELECT query could be asking for data that is actually in-flight, you lose. This is conceptually similar to the way defrag works on old FAT-type filesystems: if you used one, you'll remember that when you were defragging your disk, if you did anything else on that disk the defrag would keep restarting. This was because the OS was trying to move bits around, and when you did stuff, you screwed up its optimization. The database works differently, by taking an exclusive lock, but the basic conceptual problem is the same. A -- Andrew Sullivan | ajs@crankycanuck.ca Unfortunately reformatting the Internet is a little more painful than reformatting your hard drive when it gets out of whack. --Scott Morris