Re: Not Picking Index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "George Pavlov" <gpavlov(at)mynewplace(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Not Picking Index
Date: 2007-02-16 19:27:47
Message-ID: 3481.1171654067@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"George Pavlov" <gpavlov(at)mynewplace(dot)com> writes:
>> 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 :-)

indisvalid isn't a hint; it was necessary to make CREATE INDEX CONCURRENTLY
work. But if you want to (mis?)use it as a hint, you can ...

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Andreas Tille 2007-02-19 10:50:21 How to debug performance problems
Previous Message Mark Stosberg 2007-02-16 19:25:21 Re: reindex vs 'analyze'