Re: Reindexing primary keys without locking

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>, "Glyn Astill" <glynastill(at)yahoo(dot)co(dot)uk>
Subject: Re: Reindexing primary keys without locking
Date: 2011-06-01 13:52:00
Message-ID: 4DE5FDB0020000250003DF78@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk> 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Campbell, Lance 2011-06-01 16:56:12 logging how to add timestamp
Previous Message Ray Stell 2011-06-01 13:06:41 Re: patching the OS of a 9.0.4 db with hot standby