Skip site navigation (1) Skip section navigation (2)

Re: Bug? 8.0 does not use partial index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Palle Girgensohn <girgen(at)pingpong(dot)net>
Cc: John Hansen <john(at)geeknet(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bug? 8.0 does not use partial index
Date: 2005-01-14 01:27:21
Message-ID: 18570.1105666041@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Palle Girgensohn <girgen(at)pingpong(dot)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

In response to

pgsql-hackers by date

Next:From: David FetterDate: 2005-01-14 01:43:31
Subject: Top-k optimizations?
Previous:From: Michael FuhrDate: 2005-01-14 01:25:13
Subject: Re: Slow PL/pgSQL 8.0.RC5 (7.4.6. 3times faster)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group