MOCKSTACKS
EN
Questions And Answers

More Tutorials









Oracle Bitmap Index


CREATE BITMAP INDEX
emp_bitmap_idx
ON index_demo (gender);

.Bitmap index is used when data cardinality is low.

.Here, Gender has value with low cardinality. Values are may be Male, Female & others.

.So, if we create a binary tree for this 3 values while searching it will have unnecessary traverse.

.In bitmap structures, a two-dimensional array is created with one column for every row in the table being indexed. Each column represents a distinct value within the bitmapped index. This two-dimensional array represents each value within the index multiplied by the number of rows in the table.

.At row retrieval time, Oracle decompresses the bitmap into the RAM data buffers so it can be rapidly scanned for matching values. These matching values are delivered to Oracle in the form of a Row-ID list, and these Row-ID values may directly access the required information.


Function Based Index


CREATE INDEX first_name_idx ON user_data (UPPER(first_name));
SELECT *
FROM user_data
WHERE UPPER(first_name) = 'JOHN2';

.Function based index means, creating index based on a function.

.If in search (where clause), frequently any function is used, it's better to create index based on that function.

.Here, in the example, for search, Upper() function is being used. So, it's better to create index using upper function.


Conclusion

In this page (written and validated by ) you learned about Oracle Bitmap Index . What's Next? If you are interested in completing Oracle tutorial, your next topic will be learning about: Oracle Hints.



Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: mockstacks@gmail.com.


Share On:


Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using Mockstacks.com, you agree to have read and accepted our terms of use, cookies and privacy policy.