Re: Not Picking Index - Mailing list pgsql-performance

From George Pavlov
Subject Re: Not Picking Index
Date
Msg-id 8C5B026B51B6854CBE88121DBF097A8684DA43@ehost010-33.exch010.intermedia.net
Whole thread Raw
In response to Re: Not Picking Index  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Not Picking Index
List pgsql-performance
> Note the DROP INDEX will acquire exclusive lock on the table, so this
> might not be the greatest thing to do in a production environment.
> In PG 8.2 and up there is a sneakier way to do it that won't acquire
> any more lock than the statement-under-test does:
>
>     begin;
>     update pg_index set indisvalid = false
>       where indexrelid = 'soandso'::regclass;
>     explain analyze ...;
>     rollback;

this really smacks of that four-letter word that starts with h... -- i
am glad we have finally come around on the subject :-)

seriously, this is a great technique and an enormous time saver during
query optimization. thanks for sharing!

george

pgsql-performance by date:

Previous
From: "Steinar H. Gunderson"
Date:
Subject: Re: Not Picking Index
Next
From: Mark Stosberg
Date:
Subject: Re: reindex vs 'analyze'