[Bizgres-general] Non equality operators and bitmap indexes (was : A bitmap index access method is available...)

Mark Kirkwood markir at paradise.net.nz
Wed Dec 28 23:49:56 GMT 2005


I noticed that queries like:

bitmap=# EXPLAIN SELECT * FROM bitmaptest WHERE val0 <= 1;
                               QUERY PLAN
----------------------------------------------------------------------
  Seq Scan on bitmaptest  (cost=0.00..218458.08 rows=4633337 width=40)
    Filter: (val0 <= 1)
(2 rows)

will not use the available (bitmap) index on val0, whereas, an 
equivalent query recoded to use equality operators will happily do so:

bitmap=# EXPLAIN SELECT * FROM bitmaptest WHERE val0 in (0,1);
                                           QUERY PLAN 

----------------------------------------------------------------------------------------------
  Bitmap Heap Scan on bitmaptest  (cost=24689.68..187647.73 rows=4138460 
width=40)
    Recheck Cond: ((val0 = 0) OR (val0 = 1))
    ->  BitmapOr  (cost=24689.68..24689.68 rows=4633337 width=0)
          ->  Bitmap Index Scan on bitmaptest_val0  (cost=0.00..15790.67 
rows=2963336 width=0)
                Index Cond: (val0 = 0)
          ->  Bitmap Index Scan on bitmaptest_val0  (cost=0.00..8899.00 
rows=1670001 width=0)
                Index Cond: (val0 = 1)
(7 rows)


I'm guessing it is a TODO item, but thought I may as well mention it :-)

best wishes

Mark


More information about the Bizgres-general mailing list