Re: Bug? 8.0 does not use partial index

From: Palle Girgensohn <girgen(at)pingpong(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 00:52:30
Message-ID: F367CB34729FF974A8243CE6@palle.girgensohn.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

--On torsdag, januari 13, 2005 19.32.38 -0500 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Hansen 2005-01-14 00:52:38 Re: Bug? 8.0 does not use partial index
Previous Message Palle Girgensohn 2005-01-14 00:52:04 Re: Bug? 8.0 does not use partial index