Re: How to rebuild index efficiently

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to rebuild index efficiently
Date: 2020-08-03 18:04:45
Message-ID: e5ae6787-3f28-5afe-29db-8b19026f7e16@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/3/20 12:58 PM, Christophe Pettus wrote
>> On Aug 3, 2020, at 10:20, Konireddy Rajashekar <rajkonireddy(at)gmail(dot)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 old index. The locking that is required here is modest: CREATE INDEX CONCURRENTLY needs to lock the table briefly at a couple of points in the operation, and dropping the old index requires a brief lock on the table. It is, however, much less overall lock time than REINDEX would be.

Of course, you need enough disk space... :)

--
Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2020-08-03 18:14:20 Re: How to rebuild index efficiently
Previous Message Christophe Pettus 2020-08-03 17:58:13 Re: How to rebuild index efficiently