Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4F3EC9FB302 for ; Mon, 15 Jan 2007 10:33:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 71335-04 for ; Mon, 15 Jan 2007 10:33:00 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 24C5D9FB221 for ; Mon, 15 Jan 2007 10:32:58 -0400 (AST) 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 1H6T2w-00066L-Ma for pgsql-sql@postgresql.org; Mon, 15 Jan 2007 09:42:50 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id D8AD04051; Mon, 15 Jan 2007 09:32:47 -0500 (EST) Date: Mon, 15 Jan 2007 09:32:47 -0500 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: vacuum process taking more than 33 hours Message-ID: <20070115143247.GA13011@phlogiston.dyndns.org> References: <2529.5826.qm@web30013.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2529.5826.qm@web30013.mail.mud.yahoo.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/47 X-Sequence-Number: 27199 On Mon, Jan 15, 2007 at 06:23:23AM -0800, Mario Behring wrote: > Hi all, > > I've executed a VACUUM FULL on a database 33GB in size. The process > was going fine until it reached a index (I guess it's an index) and > there it stopped for more than 30 hours...........the whole > weekend...... It may not have been doing anything. VACUUM FULL needs to take an exclusive lock on each table it is processing. It may have been waiting for that lock. > I've canceled it but I desperately need to free some space at the > server's disk. I was thinking about using the TRUNCATE statement at > the table I know to be the largest one. I have some questions > though: TRUNCATE and VACUUM are different beasts. VACUUM recovers space from deleted or updated rows. If you have done neither of those things, then it won't recover any space. TRUNCATE is like DELETE on steriods: it simply removes all the data from your table. TRUNCATE will indeed recover disk, although I can't remember whether it actually returns that disk space to the operating system, or whether it remains allocated for the table in question by postgres. If the latter, a VACUUM FULL on the table in question ought to be enough to get you the space back. A -- Andrew Sullivan | ajs@crankycanuck.ca The fact that technology doesn't work is no bar to success in the marketplace. --Philip Greenspun