X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 53BEC537C4 for ; Tue, 19 Apr 2005 15:28:59 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 73549-09 for ; Tue, 19 Apr 2005 18:28:52 +0000 (GMT) Received: from sunsite.dcc.uchile.cl (sunsite.dcc.uchile.cl [192.80.24.2]) by svr1.postgresql.org (Postfix) with ESMTP id 073C7529DF for ; Tue, 19 Apr 2005 15:28:47 -0300 (ADT) Received: from anakena.dcc.uchile.cl (anakena [192.80.24.6]) by sunsite.dcc.uchile.cl (8.12.11/8.12.11) with ESMTP id j3JISQWM020127; Tue, 19 Apr 2005 14:28:26 -0400 (CLT) Received: by anakena.dcc.uchile.cl (Postfix, from userid 4151) id DB38552C70; Tue, 19 Apr 2005 14:28:26 -0400 (CLT) Date: Tue, 19 Apr 2005 14:28:26 -0400 From: Alvaro Herrera To: Tom Lane Cc: Tambet Matiisen , josh@agliodbs.com, Bill Chandler , pgsql-perform Subject: Re: Question on REINDEX Message-ID: <20050419182826.GA18949@dcc.uchile.cl> References: <21097.1113919600@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <21097.1113919600@sss.pgh.pa.us> User-Agent: Mutt/1.5.8i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.343 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200504/463 X-Sequence-Number: 11860 On Tue, Apr 19, 2005 at 10:06:40AM -0400, Tom Lane wrote: > BTW, VACUUM FULL does the data movement back-to-front, and stops as soon > as it finds a tuple it cannot move down; which is a reasonable strategy > since the goal is merely to make the file shorter. But it's entirely > likely that there will be lots of empty space left at the end. For > instance the final state could have one 4K tuple in the last page and > up to 4K-1 free bytes in every earlier page. Am I right in thinking that vacuum does at least two passes: one front-to-back to find removable tuples, and other back-to-front for movement? Because if it doesn't work this way, it wouldn't relabel (change Xmin/Xmax) tuples in early pages. Or does it do something different? I know maintenance_work_mem is used for storing TIDs of to-be-moved tuples for index cleanup ... how does it relate to the above? -- Alvaro Herrera () "Crear es tan difícil como ser libre" (Elsa Triolet)