EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials Oracle Tutorial Oracle Bitmap Index
Secondary Sidebar
Oracle Tutorial
  • Advanced
    • Timestamp to Date in Oracle
    • Oracle Golden Gate
    • Oracle Virtual Machine
    • Oracle Describe Table
    • Oracle Clauses
    • Oracle Having Clause
    • Oracle?Primavera
    • Oracle FOREIGN Key
    • PIVOT in Oracle
    • Oracle Alter Table
    • Oracle Queries
    • Oracle Views
    • Oracle Window Functions
    • Oracle String Functions
    • Oracle Date Functions
    • Oracle Analytic Functions
    • Oracle Aggregate Functions
    • Select in Oracle
    • INSERT in Oracle
    • DISTINCT in Oracle
    • Function in Oracle
    • Oracle GROUP_CONCAT
    • Oracle INSTR()
    • Oracle CONVERT
    • Oracle LENGTH()
    • Oracle EXISTS
    • Oracle REPLACE()
    • Oracle MERGE
    • Oracle LEAD()
    • Oracle EXTRACT()
    • Oracle LISTAGG()
    • Oracle SYS_CONTEXT()
    • Oracle COALESCE
    • Oracle NVL()
    • Oracle SYSDATE()
    • Oracle?Date Format
    • Oracle SYS_GUID()
    • Oracle WILDCARDS
    • Oracle Synonyms
    • Oracle Subquery
    • BETWEEN in Oracle
    • FETCH in Oracle
    • Oracle Index
    • Oracle Function-based Index
    • Oracle UNIQUE Index
    • Oracle Bitmap Index
    • Oracle Column
    • Oracle Triggers
    • Oracle Procedures
    • Sample Database for Oracle
    • Oracle LIKE Operator
    • ORDER BY in Oracle
    • Oracle ORDER BY DESC
    • GROUP BY in Oracle
    • Oracle GROUP BY HAVING
    • Oracle Aliases
    • Table in Oracle
    • Oracle Temporary Table
    • Oracle? Table Partition
    • Oracle rename table
    • Oracle CTE
    • Cursor in Oracle
    • Oracle LOCK TABLE
    • Oracle Tablespace
    • Oracle CARDINALITY
    • Oracle REGEXP
    • Oracle REGEXP_REPLACE
    • Oracle to_date
    • JSON in Oracle
    • Oracle COMMIT
    • Oracle GRANT
    • Oracle MD5
    • Oracle ROLLBACK
    • Oracle Users
    • Oracle TIMESTAMP
    • IF THEN ELSE in Oracle
    • Oracle While Loop
    • Oracle Clone Database
    • Oracle Backup Database
    • Oracle? XML
    • Oracle XMLAGG
    • Oracle XMLTABLE
    • Oracle Performance Tuning
    • Oracle B Tree Index
    • Oracle fusion
    • Oracle ebs
    • Oracle GRC
    • Oracle ERP
    • Oracle ASM
    • Oracle Cloud
    • Oracle HCM Cloud
    • Oracle Integration Cloud
    • Oracle Jinitiator
    • Oracle pathfinder
    • Oracle VirtualBox
    • Oracle Weblogic Server
    • Oracle decode
    • Oracle Exadata
    • Oracle ZFS
    • Oracle? utilities
    • JDBC Driver for Oracle
    • Oracle? DBA Versions
    • Oracle DBA Salary
  • Basic
    • Oracle Marketing Cloud
    • What is Oracle?
    • Career in Oracle
    • How to Install Oracle
    • Oracle Versions
    • What Is Oracle Database
    • Oracle Data Warehousing
    • Oracle Warehouse Builder
    • Career In Oracle Database Administrator
    • Career In Oracle DBA
    • What is Oracle RAC
    • Oracle DBA
    • Oracle? Vanderbilt
    • What is RMAN Oracle
    • Oracle Database Administration
    • Oracle Operators
    • Oracle Constraints
    • Oracle number
    • Oracle Data Types
    • Oracle UNIQUE Constraint
    • Oracle Check Constraint
  • Joins
    • Joins in Oracle
    • Inner Join in Oracle
    • Oracle Cross Join
    • Left Join in Oracle
    • OUTER Join in Oracle
    • Oracle Full Outer Join
    • Natural Join in Oracle
    • Oracle Self Join
    • Oracle hash join
    • Oracle? Update with Join
  • Oracle SET Operators
    • UNION in Oracle
    • Oracle UNION ALL
    • INTERSECT in Oracle
    • MINUS in Oracle
  • Interview Questions
    • Oracle Interview Questions
    • Oracle Apps Interview Questions
    • Oracle Apps Technical Interview Questions
    • Oracle Database Interview Questions
    • Oracle Forms Interview Questions
    • Oracle PL/SQL Interview Questions
    • Oracle RAC Interview Questions
    • Oracle SOA Interview Questions

Related Courses

Oracle Course Training

Oracle DBA Certification Course

MongoDB Certification Training

Oracle Bitmap Index

By Priya PedamkarPriya Pedamkar

Oracle Bitmap Index

Introduction to Oracle Bitmap Index

Oracle Bitmap Index is a schema object which contains an entry for each value that appears in the indexed column(s) of the Table or Cluster. It provides direct and fast access to rows.

  • An index is a schema object.
  • An index is used by the Oracle server to speed up retrieval of rows by using a pointer.
  • Indexes are independent of the table it Indexes, both logically and physically.
  • The index is used and maintained automatically by the Oracle server.
  • Indexes can be created or dropped at any time and do not affect the base tables or other indexes.
  • When a table is dropped, the corresponding indexes are also dropped automatically.
  • On one table more than one Index can be created, but this does not mean that more indexes lead to faster performance.
  • Each DML operation that is committed on a table with Index means that the Index must be updated.
  • Index reduces the disk I/O by using a rapid path access method to locate the data quickly.

Points of Concentration

  • The Table or Cluster to be indexed must be in the OWN schema.
  • Index object privilege should be available on the table to be indexed.
  • Create an Index system privilege that must be available for the user who needs to create an index.
  • Unlimited tablespace system privilege or space quota on space quota on tablespaces must be available.
  • The Bitmap index stores ROWID’S associated with a key-value as a bitmap.
  • Bitmap index can be a composite bitmap index.
  • Composite Bitmap index gets created on multiple columns of a table.
  • The composite bitmap index can be created upon a table to the maximum collection of 32 columns.
  • Specify Bitmap to indicate that the index has to be created with a Bitmap Distinct Key in the table.
  • Each BIT in the Bitmap corresponds to a possible ROWID.
  • These indexes are used to tune queries that use non-selective columns in their limiting conditions.
  • Bitmap index should be used only when the data is infrequently updated.
  • Bitmap indexes add to the cost of all data manipulation transactions against the tables they index.
  • The Oracle optimizer can dynamically convert Bitmap index entries to ROWID’s during the query processing.

Restriction on BITMAP Index

  • Bitmap cannot be specified when creating a global partitioned index.
  • Bitmap secondary index cannot be created on an index-organized table has a mapping table associated with it.
  • Bitmap and Unique index cannot be specified at a time.
  • Bitmap index cannot be specified for a Domain index.
  • Bitmap indexes should not be used for tables involved in OLTP.
  • Bitmap indexes increase the load factor on the internal mechanisms of Oracle to maintain them.
  • Restricted with usage to tables involved in batch transactions.

Syntax

Creating an Index:

CREATE BITMAP INDEX IndexName ON Table (ColumnName) TABLESPACE
TableSpaceName;

Dropping an Index:

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

DROP INDEX IndexName;

Description

  • IndexName: It can be any name of that Index object according to the Oracle naming convention.
  • TableSpaceName: It is a logical storage name where that index object will be stored.

Examples of Oracle Bitmap Index

In this section, we’ll see the implementation of the Oracle BITMAP Index and its behavior. For that, we will use the below sample table (Employee) with 14 records to understand the Oracle BITMAP Index behavior.

SELECT * FROM Employee;

Output:

Oracle Bitmap Index output 1

Example #1 – BITMAP Index

CREATE BITMAP INDEX EmpBitIndex ON Employee (Deptnumber);

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,527 ratings)

Output:

Oracle Bitmap Index output 2

The above create statement creates a Bitmap Index on Deptnumber.

SELECT ID,Name,Deptnumber FROM Employee WHERE Deptnumber=10;

Output:

Oracle Bitmap Index output 3

The execution plan clearly shows that the above statement does not use Index to access the rows because the oracle optimizer decides that when to use the Index.

Bitmap index adds only one bit to each row in the table being indexed to the size of the Bitmap pattern.

Each distinct value adds another row to the Bitmap index.

Example #2 – How to check Indexes

The index can be checked from the USER_INDEXES data dictionary.

SELECT Table_Name,Index_Name FROM USER_INDEXES WHERE
TABLE_NAME='EMPLOYEE';

Output:

output 4

Example #3 – Dropping Bitmap Index

The index can be dropped at any time but User needs to have drop privilege.

DROP INDEX EmpBitIndex;

Output:

output 5

In the above example, using a drop index syntax index gets dropped. So now the Employee table does not have any Index.

SELECT Table_Name,Index_Name FROM USER_INDEXES WHERE
TABLE_NAME='EMPLOYEE';

Output:

output 6

Example #4 – When to Use BITMAP Index

  • Low cardinality column: It means any column which consists of less than 100 distinct values.
  • Infrequently updated or Read-only tables: Bitmap indexes are good for the read-only tables or tables that do not get updated frequently. It is extensively being used in the data warehouse.

Tip:

  • It is an expensive Index to maintain if distinct key values increase.
  • It reduces performance if the distinct key values increases.

Conclusion

Oracle BITMAP Indexes are very useful for the static table or static column. It is also useful for the Materialized view. Need to take extra care about distinct key values to create a BITMAP index.

Recommended Articles

This is a guide to Oracle Bitmap Index. Here we discuss the points of concentration, restriction on BITMAP Index with query examples. You may also have a look at the following articles to learn more –

  1. Oracle Users
  2. Oracle EXTRACT()
  3. Oracle LOCK TABLE
  4. Oracle ROLLBACK
Popular Course in this category
Oracle Training (14 Courses, 8+ Projects)
  14 Online Courses |  8 Hands-on Projects |  120+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Oracle DBA Database Management System Training (2 Courses)4.9
All in One Financial Analyst Bundle- 250+ Courses, 40+ Projects4.8
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more