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

From Sergey Konoplev
Subject Re: Disable an index temporarily
Date
Msg-id CAL_0b1vza=T9DmLcg5kBgA1vgpRrZ-GBrMmEBG_FTj8-n5Zvug@mail.gmail.com
Whole thread Raw
In response to Disable an index temporarily  (Torsten Förtsch <torsten.foertsch@gmx.net>)
Responses Re: Disable an index temporarily  (Torsten Förtsch <torsten.foertsch@gmx.net>)
List pgsql-general


On Apr 19, 2014 1:53 PM, "Torsten Förtsch" <torsten.foertsch@gmx.net> wrote:
>
> Hi,
>
> an index can be INVALID (pg_index.indisvalid=false).
>
> I want to temporarily disable an index so that it won't be used to
> access data but will still be updated.
>
> Can I simply set pg_index.indisvalid=false and later turn it true again?

It works on a quick test, but I'm not sure how safe it is.

If you need to test a query without the index use a transaction:

Begin;
Drop index ...;
Explain ... select ...;
Rollback;

>
> Thanks,
> Torsten
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Jov
Date:
Subject: Re: Could use some advice on search architecture
Next
From: Torsten Förtsch
Date:
Subject: Re: Disable an index temporarily