Re: temporarily deactivate an index - Mailing list pgsql-general

From Scott Marlowe
Subject Re: temporarily deactivate an index
Date
Msg-id dcc563d10806072334g17a1f01fg3115bf8f057414d8@mail.gmail.com
Whole thread Raw
In response to Re: temporarily deactivate an index  (Viktor Rosenfeld <rosenfel@informatik.hu-berlin.de>)
Responses Re: temporarily deactivate an index  ("Jaime Casanova" <systemguards@gmail.com>)
List pgsql-general
On Sat, Jun 7, 2008 at 5:16 PM, Viktor Rosenfeld
<rosenfel@informatik.hu-berlin.de> wrote:
> Hi Scott,
>
> Am 07.06.2008 um 16:53 schrieb Scott Marlowe:
>>>
>>> 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;
>
> That works, but I'm still looking for another way to deactivate the index.
>  The reason being, that my query load is randomly generated by a Java
> program and I don't want to go and change the SQL compiler.

Sorry, I'm out of ideas.  I mean, you can turn off all indexes with
set enable_indexscan=off but there's no other way to do it cheaply and
in such a fine grained way.

pgsql-general by date:

Previous
From: Viktor Rosenfeld
Date:
Subject: Re: temporarily deactivate an index
Next
From: "Gurjeet Singh"
Date:
Subject: Re: when to reindex?