Why my bitmap index doesnt speed up my query

56 Views Asked by At

So i define bitmap index for column_a. then i query

Select column_a, column_b 
from table_name 
where column_a = 'values';

But after i check the Explain plan, my query still do a table access full scan. but if i only do

Select column_a
from table_name 
where column_a = 'values';

it successfully use my defined index

1 | BITMAP CONVERSION TO ROWIDS

2 | BITMAP INDEX SINGLE VALUE

my question then, should i define all index on all columns that i want to query? even though some of the columns have high cardinality?

1

There are 1 best solutions below

3
On

Index should cover where clause columns along with table columns mentioned in select clause. In general you should at least cover where clause columns and depending on column data type,frequency of usage of query select clause may follow. Remember over indexed table can degrade database performance

Note: 
 1.If you defined index with all columns it will not that useful index considering index size,performance and maintenance
 2.B-tree indexes are most effective for high-cardinality data.

Oracle official documentation