What is B tree Index ?| B Tree Index with industry examples

B tree Index :

In my previous article i have given the information about the bitmap index with real life examples.In this article i would like to give you information about B tree index with real life examples.User should know that Oracle should create B-tree index by default.B-tree indexes also known as balanced tree indexes.These are most common type of database index. The classic b-tree index structure,there are branches from the top that lead to leaf nodes that contains data.The B-tree structure is from branches to leaf nodes.

Where to use B-tree Indexes ?

So everyone have question in mind that where exactly we need to use the B tree index.The B-tree index is most used index used to improve the performance of any application or any sql query. The main use of B-tree index is to improve the performance of SQL Queries. I have given some examples of bitmap index and instructions about where to use the bitmap indexes. Just like that i would like to give you the information about some guidelines to use B-tree indexes :

1.Primary key tables :

The B-tree indexes are useful when there is primary key for the table.

2.Sorting is needed :

The B-tree index is used when sorting is needed for improving the performance of query.

Real life example :

I would like to give one example of sorting. The sorting is important in some of cases. Lets say Student table has joined with Student_master table and it is joined with Roll_No column.The Roll_No column is not sorted in the table.To apply sorting on that column kindly create b-tree index on that column so as to improve the performance.

Create index SI_Student_Roll_No

on Student(Roll_No);

Create index SI_Student_master_Roll_No

on Student_Master(Roll_No);

These two indexes gives the better performance as the sorting applied properly on it.

3.Range Searches :

The B-tree index is most useful in the range queries or range searches queries.

Real life example :

Lets say user need to fetch the report of Students from Student table where the admission is between 1st Jan 2018 to 31 Jan 2018.So User need to add index on date.

Sub Types of B-Tree Indexes :

In this section i would like to give you different types of B-tree index with some examples.

Type 1 : Index Organized Table :

The index organized tables are different from regular heap organized tables. In Index organized table the rows are stored in an index defined on primary key for that table.The Logical rowid will build the secondary indexes.

Type 2 : Reverse key index :

For some situations The bytes of index key are reversed.Example is 123 is stored as 321.The reverse key index is used to solve the problem of contention for leaf block and improves the performance.

Type 3 : Descending Index :

There are some situations where user needs the data in descending order. For these situations user needs to use B-tree indexes in descending order.The most important indexes used in BI reporting queries as lot of columns from the table in reporting needs descending order data.

Example :

Create index Desc_Student_Roll_No on Student (Roll_No Desc);


Type 4 : Clustered Index :

The another type of index named Clustered index which uses the cluster key for indexing.

These are four sub-types of B-tree indexes. I hope you get the idea about B-tree index in detail.kindly comment in comment section if you like this article or if you have any suggestions.

Amit S

Oracle Consultant with vast experience in Oracle BI and PL/SQL Development. Amiet is the admin head of this website who contributes by preparing tutorials and articles related to database technologies. He is responsible to manage the content and front-end of the website.

Recent Posts

Application Support Engineer Day to day responsibilities

In my previous articles I have given the roles and responsibilities of L1,L2 and L3…

2 days ago

What is mean by SLA ( Service Level Agreement) with Examples?

In my previous articles i have given the hierarchy of production support in real company…

5 days ago

What is Production support Hierarchy in organization?

In this article i would like to provide information about production support organization structure or…

5 days ago

What are roles and responsibilities for L3 Support Engineer?

In my previous article I have given roles for L1 and L2 support engineer with…

5 days ago

What are roles and responsibilities of L2 Engineer?

I have started this new series of how to become application support engineer. This article…

5 days ago

What are Roles and Responsibilities of L1 Support Engineer with real industry examples?

In this series we are starting with Roles and responsibilities of L1 support engineer .…

5 days ago