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 70F6553393 for ; Mon, 18 Apr 2005 16:34:32 -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 54837-03 for ; Mon, 18 Apr 2005 19:34:31 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id 9CE3653398 for ; Mon, 18 Apr 2005 16:34:29 -0300 (ADT) Received: (qmail 5311 invoked by uid 500); 18 Apr 2005 19:53:58 -0000 Date: Mon, 18 Apr 2005 14:53:58 -0500 From: Bruno Wolff III To: Bill Chandler Cc: pgsql-perform Subject: Re: Question on REINDEX Message-ID: <20050418195358.GA4961@wolff.to> Mail-Followup-To: Bruno Wolff III , Bill Chandler , pgsql-perform References: <20050418192142.84419.qmail@web51405.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050418192142.84419.qmail@web51405.mail.yahoo.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/434 X-Sequence-Number: 11831 On Mon, Apr 18, 2005 at 12:21:42 -0700, Bill Chandler wrote: > > Running PostgreSQL 7.4.2 on Solaris. > > 1) When is it necessary to run REINDEX or drop/create > an index? All I could really find in the docs is: > > "In some situations it is worthwhile to rebuild > indexes periodically with the REINDEX command. (There > is also contrib/reindexdb which can reindex an entire > database.) However, PostgreSQL 7.4 has substantially > reduced the need for this activity compared to earlier > releases." In pathologic cases it is possible to have a lot of empty space on a lot of your index pages. Reindexing would change that to a smaller number. In earlier versions, I think it was possible to have completely empty pages and this happened for patterns of use (new values monotonically increasing, oldest values deleted first) that were actually seen in practice.