Re: Bug? 8.0 does not use partial index - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug? 8.0 does not use partial index
Date
Msg-id 18570.1105666041@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug? 8.0 does not use partial index  (Palle Girgensohn <girgen@pingpong.net>)
List pgsql-hackers
Palle Girgensohn <girgen@pingpong.net> writes:
> Interesting. Yes, I might be that desperate, actually. As desperate as 30 s 
> vs 30 ms can get me... :)

> And this one would actually accumulate stats alright? Looks kinda hairy to 
> me. It's not really a partial index anymore, but I guess that doesn't 
> matter...

Yeah, it would.  The trick is finding a mapping function that will map
all the cases you care about to distinct values.

> How is the behaviour on 7.4 for this stuff? It seems 7.4 does use the 
> partial index, but not always, as shown in a previous mail. Will this 
> example work on both versions, or just for 8.0?

7.4 doesn't keep stats on functional indexes, so the hack is a
nonstarter there.

I am not sure why you are seeing different results on 7.4 than 8.0 for
the original example --- 7.4 is certainly not smarter than 8.0, and we
seem to have ruled out the idea that some sort of glitch is confusing
the 8.0 planner.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Palle Girgensohn
Date:
Subject: Re: Bug? 8.0 does not use partial index
Next
From: David Fetter
Date:
Subject: Top-k optimizations?