1 / 14

BITMAP INDEXES

BITMAP INDEXES. Barot Rushin (Id :- 108). Introduction. A bitmap index is a special kind of index that stores the bulk of its data as bit arrays (commonly called "bitmaps"). It answers most queries by performing bitwise logical operations on these bitmaps.

Download Presentation

BITMAP INDEXES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BITMAP INDEXES BarotRushin (Id :- 108)

  2. Introduction • A bitmap index is a special kind of index that stores the bulk of its data as bit arrays (commonly called "bitmaps"). • It answers most queries by performing bitwise logical operations on these bitmaps. • The bitmap index is designed for cases where number of distinct values is low, in other words, the values repeat very frequently.

  3. Example • Suppose a file consists of records with two fields, F and G, of type integer and string, respectively. The current file has six records, numbered 1 through 6, with the following values in order:

  4. Example (contd…) • A bitmap index for the first field, F, would have three bit-vectors, each of length 6 as shown in the table. • In each case, the 1's indicate in which records the corresponding string appears. • Table 2

  5. Example (contd…) • A bitmap index for the first field, G, would have three bit-vectors, each of length 6 as shown in the table. • In each case, the 1's indicate in which records the corresponding string appears. • Table 3

  6. Motivation for Bitmap Indexes: • Bitmap indexes can help answer range queries. • Example: • Given is the data of a jewelry stores. The attributes considered are age and salary. • Table 4

  7. Motivation (contd…) • A bitmap index for the first field Age, would have seven bit-vectors, each of length 12 as shown in the table. • In each case, the 1's indicate in which records the corresponding string appears. • Table 5

  8. Motivation (contd…) • A bitmap index for the second field Salary, would have ten bit-vectors, each of length 12 as shown in the table. • In each case, the 1's indicate in which records the corresponding string appears. • Table 5

  9. Motivation (contd…) • Suppose we want to find the jewelry buyers with an age in the range 45-55 and a salary in the range 100-200. • We first find the bit-vectors for the age values in this range; in this example there are only two: 010000000100 and 001110000010, for 45 and 50, respectively. If we take their bitwise OR, we have a new bit-vector with 1 in position i if and only if the ith record has an age in the desired range. • This bit-vector is 011110000110.

  10. Motivation (contd…) • Next, we find the bit-vectors for the salaries between 100 and 200 thousand. • There are four, corresponding to salaries 100, 110, 120, and 140; their bitwise OR is 000111100000.

  11. Motivation (contd…) • The last step is to take the bitwise AND of the two bit-vectors we calculated by OR. • That is: 011110000110 AND 000111100000 ----------------------------------- 000110000000

  12. Motivation (contd…) • We thus find that only the fourth and fifth records, which are (50,100) and (50,120), are in the desired range.

  13. Issues for Bitmap Indexes • Managing Bitmap indexes • Memory requirement.

  14. Managing Bitmap indexes • Finding Bit-Vectors • Finding Records • Handling modifications to the data file. • Record numbers must remain fixed once assigned. • Changes to the data file require the bitmap index to change as well.

More Related