Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 563DEB5FDA5 for ; Wed, 1 Jun 2011 10:52:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 54806-07 for ; Wed, 1 Jun 2011 13:52:10 +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 6876CB60B81 for ; Wed, 1 Jun 2011 10:52:10 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 01 Jun 2011 08:52:09 -0500 Message-Id: <4DE5FDB0020000250003DF78@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 01 Jun 2011 08:52:00 -0500 From: "Kevin Grittner" To: "pgsql-admin@postgresql.org" , "Glyn Astill" Subject: Re: Reindexing primary keys without locking References: <35505.8950.qm@web26008.mail.ukl.yahoo.com> In-Reply-To: <35505.8950.qm@web26008.mail.ukl.yahoo.com> 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=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/6 X-Sequence-Number: 37632 Glyn Astill wrote: > Does anyone know of any tricks to replace primary key indexes > without using reindex? Or any other method that will not lock the > table for an extended amount of time on 8.4? > > I've got a bloated primary key index on a table and I'd like to > try and clean it up without downtime. You could create a unique index concurrently on the same columns. Perhaps that would help with performance problems from the bloat until you had a window to drop the redundant index and reindex the table? -Kevin