Re: temporarily deactivate an index

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Viktor Rosenfeld" <rosenfel(at)informatik(dot)hu-berlin(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: temporarily deactivate an index
Date: 2008-06-07 14:53:01
Message-ID: dcc563d10806070753v1392a10gfadb68939b09ca02@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jun 7, 2008 at 8:05 AM, Viktor Rosenfeld
<rosenfel(at)informatik(dot)hu-berlin(dot)de> wrote:
> Hi,
>
> I'm experimenting with different indexes to speed up my queries and I was
> wondering if it is possible to temporarily deactivate an index, so it won't
> be considered in the evaluation of query plans. The reason is that dropping
> and then rebuilding an index takes up time which I would rather not wait.
>
> I couldn't find a command to do that, but I'm guessing that it should be
> possible by manipulating a structure in the catalog?

Try this:

begin;
drop indexname;
explain analyze select ...;
rollback;

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-06-07 15:19:10 Re: IN vs EXISTS
Previous Message Jeremy Harris 2008-06-07 14:37:12 Re: when to reindex?