--On torsdag, januari 13, 2005 19.32.38 -0500 Tom Lane <tgl@sss.pgh.pa.us>
wrote:
> I wrote:
>> I thought of a fairly miserable hack, which relies on the fact that 8.0
>> does know how to accumulate statistics on functional indexes:
>
> Never mind, it turns out that doesn't work the way I thought. It's
> actually falling back to a default estimate :-(. I still think it'd
> be a good idea to use stats on partial indexes in future releases,
> but right at the moment we aren't doing any such thing.
Oh, uh, too bad :(
> Here's an even more miserable hack: use a non-partial functional index
> over a multicolumn expression as a poor man's way of creating
> cross-column stats. For example, assuming all this_group_id values are
> positive:
[snip]
> Dunno if you're desperate enough to try that ... but it does seem to work.
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...
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?
BTW, shall I file some kind of bug report / feature request about
accumulating stats for partial indices etc... Perhaps you're best equipped
to file such a report ;-) ?
Reagards,
Palle