Re: How to rebuild index efficiently - Mailing list pgsql-general

From Christophe Pettus
Subject Re: How to rebuild index efficiently
Date
Msg-id 5131947A-0470-46C0-93B8-7AE07BBC22FA@thebuild.com
Whole thread Raw
In response to How to rebuild index efficiently  (Konireddy Rajashekar <rajkonireddy@gmail.com>)
Responses Re: How to rebuild index efficiently
List pgsql-general

> On Aug 3, 2020, at 10:20, Konireddy Rajashekar <rajkonireddy@gmail.com> wrote:
> Could you please suggest any ideal approach to tackle this ?

You can do CREATE INDEX CONCURRENTLY to build a new index with the same definition, and when that is complete, drop the
oldindex.  The locking that is required here is modest: CREATE INDEX CONCURRENTLY needs to lock the table briefly at a
coupleof points in the operation, and dropping the old index requires a brief lock on the table.  It is, however, much
lessoverall lock time than REINDEX would be. 

--
-- Christophe Pettus
   xof@thebuild.com




pgsql-general by date:

Previous
From: Konireddy Rajashekar
Date:
Subject: How to rebuild index efficiently
Next
From: Ron
Date:
Subject: Re: How to rebuild index efficiently