Re: disabling an index without deleting it?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>, "Peter Koczan" <pjkoczan(at)gmail(dot)com>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: disabling an index without deleting it?
Date: 2008-02-26 22:22:40
Message-ID: 9050.1204064560@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> wrote:
>> begin;
>> drop index abc_dx;
>> select ....
>> rollback;
>>
>> and viola, your index is still there. note that there are likely some
>> locking issues with this, so be careful with it in production. But on
>> a test box it's a very easy way to test various indexes.

> Wouldn't you also bloat the index?

No, what makes you think that? The index won't change at all in the
above example. The major problem is, as Scott says, that DROP INDEX
takes exclusive lock on the table so any other sessions will be locked
out of it for the duration of your test query.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Joshua D. Drake 2008-02-26 22:37:38 Re: disabling an index without deleting it?
Previous Message Joel Stevenson 2008-02-26 22:18:07 Re: LISTEN / NOTIFY performance in 8.3