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 25322533B7 for ; Mon, 18 Apr 2005 16:28:53 -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 52262-07 for ; Mon, 18 Apr 2005 19:28:52 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id DA5B2533B1 for ; Mon, 18 Apr 2005 16:28:51 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [64.81.245.111] (account josh@agliodbs.com HELO temoku.sf.agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 7249592; Mon, 18 Apr 2005 12:30:50 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Bill Chandler Subject: Re: Question on REINDEX Date: Mon, 18 Apr 2005 12:33:56 -0700 User-Agent: KMail/1.7.1 Cc: pgsql-perform References: <20050418192142.84419.qmail@web51405.mail.yahoo.com> In-Reply-To: <20050418192142.84419.qmail@web51405.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200504181233.56784.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.049 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/432 X-Sequence-Number: 11829 Bill, > 1) When is it necessary to run REINDEX or drop/create > an index? All I could really find in the docs is: If you need to VACUUM FULL, you need to REINDEX as well. For example, if you drop millions of rows from a table. > 2) If reindexing is necessary, how can this be done in > a non-obtrusive way in a production environment. Our > database is being updated constantly. REINDEX locks > client apps out while in progress. Same with "CREATE > INDEX" when we drop/create. The table can have over > 10 million row. Recreating the indexes seems to take > hours. This is too long to lock the client apps out. > Is there any other solution? Better to up your max_fsm_pages and do regular VACUUMs regularly and frequently so that you don't have to REINDEX at all. -- --Josh Josh Berkus Aglio Database Solutions San Francisco