Re: Best way to scan on-disk bitmaps

Manfred Koizar <mkoi-pg@aon.at>

From: Manfred Koizar <mkoi-pg@aon.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "Victor Y. Yegorov" <viy@mits.lv>, Postgres Hackers <pgsql-hackers@postgresql.org>
Date: 2005-05-15T19:22:59Z
Lists: pgsql-hackers
On Thu, 12 May 2005 17:40:06 -0400, Tom Lane <tgl@sss.pgh.pa.us>
wrote:
>the planner believes that only
>consecutive columns in the index are usable --- that is, if you have
>quals for a and c but not for b, it will think that the condition for c
>isn't usable with the index.  This is true for btree [...]

It's not difficult to setup a test case where an index is used, but
only with a=42 as an index condition, and c='foo' is applied as a
filter condition.  Now add a redundant condition on b
	... AND b BETWEEN minb AND maxb ...
and watch how c='foo' moves into the index condition.

I did this test some time ago and I believe that adding the condition
on b did not change the estimated cost, only the actual execution
time.

Servus
 Manfred