[Bizgres-general] Re: Non equality operators and bitmap
indexes (was : A bitmap index access method is available...)
Simon Riggs
simon at 2ndquadrant.com
Fri Dec 30 21:08:37 GMT 2005
On Wed, 2005-12-28 at 23:02 -0800, Jie Zhang wrote:
> There are three known encoding schemes for the bitmap index: the equality
> scheme (each bitmap is associated with each one of all distinct values), the
> interval scheme (each bitmap is associated with several distinct values that
> lie within an interval), and the range scheme (each bitmap is associated
> with distinct values that are less/greater than a given value). Each of
> these schemes has different performance advantages for different queries.
> Currently, we only support the equality scheme. I think that the better way
> is to let users decide which encoding scheme to use. Any comments on this?
You should be able to do as Mark suggests, irrespective of the coding
scheme used. (More work....)
It seems valid to be able to ask for all bitmaps where value > Constant,
just as you can ask for one bitmap = Constant. If there is more than one
bitmap that meets the equation, then you simply Or them all together.
This is almost identical logic to Partitioning. Have a look at
optimizer/util/predtest.c
...or if your bitmap values are stored in a b-tree, just use an
indexscan to retrieve the list of values, Or-ing as you go.
The operator must be a B-tree op class, and the datatype must be a
orderable datatype etc
Best Regards, Simon Riggs
More information about the Bizgres-general
mailing list