Oracle Index Types
Oracle Index Types
http://www.asktheoracle.net/oracle-index-types.html
What are the different types of indexes in Oracle? Please give examples for all indexes. There are several types of indexes available in Oracle all designed for different circumstances: b*tree indexes - the most common type (especially in OLTP environments) and the default type b*tree cluster indexes - for clusters hash cluster indexes - for hash clusters reverse key indexes - useful in Oracle Real Application Cluster (RAC) applications bitmap indexes - common in datawarehouse applications partitioned indexes - also useful for datawarehouse applications function-based indexes index organised tables domain indexes Let's look at these Oracle index types in a little more detail.
B*Tree Indexes
B*tree stands for balanced tree. This means that the height of the
1 of 4
1/2/2013 5:17 PM
http://www.asktheoracle.net/oracle-index-types.html
index is the same for all values thereby ensuring that retrieving the data for any one value takes approximately the same amount of time as for any other value. Oracle b*tree indexes are best used when each value has a high cardinality (low number of occurrences)for example primary key indexes or unique indexes. One important point to note is that NULL values are not indexed. They are the most common type of index in OLTP systems.
Bitmap Indexes
These are commonly used in datawarehouse applications for tables with no updates and whose columns have low cardinality (i.e. there are few distinct values). In this type of index Oracle stores a bitmap for each distinct value in the index with 1 bit for each row in the table. These bitmaps are
2 of 4
1/2/2013 5:17 PM
http://www.asktheoracle.net/oracle-index-types.html
expensive to maintain and are therefore not suitable for applications which make a lot of writes to the data. For example consider a car manufacturer which records information about cars sold including the colour of each car. Each colour is likely to occur many times and is therefore suitable for a bitmap index. CREATE BITMAP INDEX car_col ON cars(colour) REVERSE;
Partitioned Indexes
Partitioned Indexes are also useful in Oracle datawarehouse applications where there is a large amount of data that is partitioned by a particular dimension such as time. Partition indexes can either be created as local partitioned indexes or global partitioned indexes. Local partitioned indexes means that the index is partitioned on the same columns and with the same number of partitions as the table. For global partitioned indexes the partitioning is user defined and is not the same as the underlying table. Refer to the create index statement in the Oracle SQL language reference for details.
Function-based Indexes
As the name suggests these are indexes created on the result of a function modifying a column value. For example CREATE INDEX upp_ename ON emp(UPPER(ename)); The function must be deterministic (always return the same value for the same inputs).
Domain Indexes
These indexes are created by user-defined indexing routines and enable the user to define his or her own indexes on custom data types (domains) such as pictures, maps or fingerprints for example. These type of index require in-depth knowledge about the data and how it will be accessed. Looking for more help with Oracle? With our partners, we offer instructor-led training in the UK and in the US as well as classroom-
3 of 4
1/2/2013 5:17 PM
http://www.asktheoracle.net/oracle-index-types.html
quality online training. See our Oracle training page for more details.
Click here to add your own comments Join in and write your own page! It's easy to do. How? Simply click here to return to Oracle Questions
4 of 4
1/2/2013 5:17 PM