Re: Disabling an index temporarily

From: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, Tatsuo Ishii *EXTERN* <ishii(at)postgresql(dot)org>, "jd(at)commandprompt(dot)com" <jd(at)commandprompt(dot)com>
Cc: "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgreSQL(dot)org>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: Disabling an index temporarily
Date: 2015-12-12 11:01:22
Message-ID: 566BFE82.5010401@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/12/2015 11:42, Albe Laurenz wrote:
> Tatsuo Ishii wrote:
>>> Wouldn't something like:
>>>
>>> ALTER INDEX foo SET DISABLED;
>>>
>>> See more in line with our grammar?
>>
>> But this will affect other sessions, no?
>
> Not if it is used in a transaction that ends with a ROLLBACK,
> but then you might as well use DROP INDEX, except
> that DROP INDEX takes an access exclusive lock.
>
> Yours,
> Laurenz Albe
>

Oleg and Teodor announced some time ago an extension for this exact use
case, see
http://www.postgresql.org/message-id/Pine.LNX.4.64.0910062354510.6801@sn.sai.msu.ru

This also has the advantage of not needing an exclusive lock on the index.

--
Julien Rouhaud
http://dalibo.com - http://dalibo.org

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2015-12-12 11:13:12 Re: Disabling an index temporarily
Previous Message Craig Ringer 2015-12-12 10:48:58 Re: Logical replication and multimaster