The Oracle bitmap index assumes that a table with rows has a field that is frequently used as a query condition. We will create an index on this column. However, this column may only have three values. If a B * tree index (Common Index) is created, a lot of data may be found no matter which value it looks. Then the bitmap index will be very suitable. If we create a BITMAP index in the job column of the emp table: SQL code www.2cto.com create BITMAP index job_idx on emp (job); The content stored by oracle in the index may be like this:
ANALYST, CLERK, MANAGER, PERSIDENT, and SALESMAN are all possible values in the job column. Only nine rows are listed above, and there may be more than 10 million rows. 1 indicates taking this value, and 0 indicates not taking it. For example, the value of Row 8 is ANALYST, and the first behavior is CLERK. At this time, if we want to find all the row data with the value of CLERK, it is easy to find out. Bitmap indexing is most suitable for data with low different base numbers. Low differences base numbers are 4000 rows of data, and 2 are different base numbers. There are only two rows of tables. Of course, 1 is not a different base. That is, if a column can only take a few values and the data volume of the table is large, this column is suitable for creating a bitmap index. Www.2cto.com uses Bitmap indexes for Data Warehouse and ad hoc queries. In addition, bitmap indexes are suitable for systems with high read density and are not suitable for systems with high write density. Because a row is modified, all rows (hundreds of rows) pointed to by the above bitmap index will be locked ). Because an index of a bitmap index points to multiple rows of data, rather than just one row of data as a normal index.