X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D5C87D1C4DF for ; Fri, 1 Aug 2003 14:29:57 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 46381-03 for ; Fri, 1 Aug 2003 11:28:54 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id EB878D1C4D5 for ; Fri, 1 Aug 2003 11:29:55 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h71ETuQ3007816; Fri, 1 Aug 2003 10:29:57 -0400 (EDT) To: Sam Barnett-Cormack Cc: PostgreSQL Administrators Mailing List Subject: Re: VACUUM/VACUUM FULL/REINDEX In-reply-to: References: Comments: In-reply-to Sam Barnett-Cormack message dated "Fri, 01 Aug 2003 09:56:47 +0100" Date: Fri, 01 Aug 2003 10:29:55 -0400 Message-ID: <7815.1059748195@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/19 X-Sequence-Number: 9742 Sam Barnett-Cormack writes: > I'm a little confused about comments I've seen on this list - a VACUUM > is not enough, clearly, to maintain a trim, efficient DB. People have > mentioned that REINDEX is also needed periodically. If you have an index whose range of values continually shifts (for example, a timestamp or serial-number column) then you will probably need to REINDEX it every so often to reclaim empty space in the index. This is at least partially fixed for 7.4, but it's necessary in all prior versions. The problem is that VACUUM had no mechanism to reclaim btree pages that become totally empty because there's no longer any data in the range of key values they represent. When the indexed column's statistics aren't changing much over time, I wouldn't think you'd need to do routine reindexing --- just keeping after the table with VACUUM ought to be enough. regards, tom lane