Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 815FE1337B95 for ; Tue, 5 Oct 2010 12:25:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 78222-02 for ; Tue, 5 Oct 2010 15:25:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 257191337B8D for ; Tue, 5 Oct 2010 12:25:15 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 05 Oct 2010 10:24:29 -0500 Message-Id: <4CAAFCDA0200002500036520@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 05 Oct 2010 10:24:26 -0500 From: "Kevin Grittner" To: "Kieren Scott" , Subject: Re: vacuum full table - internals in 8.3 References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/38 X-Sequence-Number: 35779 Kieren Scott wrote: > I'm trying to understand what is going on internally when doing a > VACUUM FULL on a table in 8.3. > > I have a table that is 1GB in size, 500M is used, and 500M is free > space. When I do a vacuum full on this table, will it either: - > > 1) Compact all of the used tuples into free space within the > existing disk file and then shrink the file to 500M. Therefore > simply freeing up 500M in the disk file. On 8.3, this is what it will do, although it can take a very long time. I've given up on this before completion (sometimes after leaving it cranking away for a couple days) every time I've tried it on a table with more than a few GB and any significant bloat. I don't know that I've ever tried it on a table as small as you describe, but I would bet that CLUSTER is going to be much faster if you have the half a GB free space. Another issue with VACUUM FULL is that it bloats indexes; so you generally need to follow it with a REINDEX on the table. -Kevin