Bitmap and Bitmap Join Index
Bitmap and Bitmap Join Index
INDEX
What is Bitmap indexing?
Bitmap Indexing is a special type of database indexing that uses bitmaps.
This technique is used for huge databases, when column is of low cardinality
columns and these columns are most frequently used in the query.
Bitmap vs B-tree
• B-tree and Bitmap indexes are internally different but functionally they are same
in retrieving rows faster than a full-table scan.
• Cardinality differences: Bitmap indexes are used on the columns which has lots of
duplicate values(low cardinality) while B-tree indexes are useful when there is less
or no duplicate values (high cardinality).
• Structural difference: B-tree index uses a tree-like structure with index nodes,
where Bitmap index uses a two dimensional array with zeros and ones (bits)
values.
• B-Tree index impose a small penalty when inserting/updating values on the
indexed table while Bitmap are very inefficient when inserting/updating values.
Need of Bitmap indexing
For example, Let us say that a company holds an employee table with entries like
EmpNo, EmpName, Job, New_Emp and salary. Let us assume that the employees
are hired once in the year, therefore the table will be updated very less and will
remain static most of the time. But the columns will be frequently used in queries
to retrieve data like : No. of female/male employees in the company etc
How Bitmap index Work
tblEmployee Emp_no Emp_name JobTitle New_emp Salary
Emp_no 1 Nikunj Analyst Yes 100000
Emp_name 2 Chintan Sales No 15000
JobTitle Person
New_emp 3 Prakruti Clerk No 20000
Salary 4 Martin Manager Yes 2500000