What is the Need for Bitmap Indexing?
The need for Bitmap Indexing will be clear through the below-given example:
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 a 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 employees in the company etc. In this case, we need a file organization method that should be fast enough to give quick results. But any of the traditional file organization methods are not that fast, therefore we switch to a better method of storing and retrieving data known as Bitmap Indexing.
Bitmap indexing can be used to improve the performance of queries that involve complex logical operations, such as AND, OR, and NOT. The logical operations are performed on the bit vectors, which can be efficiently combined using bitwise operators.
Bitmap indexing is particularly useful for datasets with low cardinality columns, where each value appears in a large number of rows. It is also useful for read-only queries that involve aggregations, such as counting or summing values, as the bit vectors can be quickly scanned to retrieve the required data.
Bitmap Indexing in DBMS
Bitmap Indexing is a data indexing technique used in database management systems (DBMS) to improve the performance of read-only queries that involve large datasets. It involves creating a bitmap index, which is a data structure that represents the presence or absence of data values in a table or column.
In a bitmap index, each distinct value in a column is assigned a bit vector that represents the presence or absence of that value in each row of the table. The bit vector contains one bit for each row in the table, where a set bit indicates the presence of the corresponding value in the row, and a cleared bit indicates the absence of the value.