Search Postgresql Archives

Re: Disable an index temporarily

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Apr 19, 2014 1:53 PM, "Torsten Förtsch" <torsten.foertsch@xxxxxxx> 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@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux