Multilevel Indexing (original) (raw)

Last Updated : 2 Jan, 2026

Multilevel indexing is a technique used when a single-level index becomes too large to store in main memory. To make searching faster and more efficient, the index is divided into multiple levels similar to a tree structure. The multilevel indexing separates the main block into various smaller blocks so that the same data can be stored in a single block.

Need of Multilevel Indexing

multilevel_indexing_in_dbms

Types of Multilevel Indexing

There are two main types of multilevel indexing are : B-Tree and B+ tree

**B-Tree

A B-Tree is a specialized m-way tree designed to optimize data access, especially on disk-based storage systems.

90

Example of B Tree

B+ tree

A B+ Tree is an advanced data structure used in database systems and file systems to maintain sorted data for fast retrieval, especially from disk.

100

Example of B+ Tree

B Tree vs. B+ Tree

Basis of Comparison **B Tree **B+ Tree
**Pointers All internal and leaf nodes have data pointers Only leaf nodes have data pointers
**Search All keys are not available at leaf, search often takes more time. All keys are at leaf nodes, hence search is faster and more accurate.
**Redundant Keys No duplicate of keys is maintained in the tree. Duplicate of keys are maintained and all nodes are present at the leaf.
**Insertion Insertion takes more time and it is not predictable sometimes. Insertion is easier and the results are always the same.
**Deletion Deletion of the internal node is very complex and the tree has to undergo a lot of transformations. Deletion of any node is easy because all node are found at leaf.
**Leaf Nodes Leaf nodes are not stored as structural linked list. Leaf nodes are stored as structural linked list.
**Number of Nodes Number of nodes at any intermediary level ‘l’ is 2l. Each intermediary node can have n/2 to n children.
**Application General balanced trees; less common for indexing Multilevel indexing, databases (e.g., MySQL InnoDB) for range queries

Features of Multilevel Indexing

Applications:

Comparison with Single-Level Indexing

Single-level indexing is suitable for small datasets, but as the database grows, it becomes inefficient due to high disk I/O. Multilevel indexing overcomes this by organizing indexes into a hierarchical structure, enabling faster and more efficient searches.

**Example with Practical Numbers:

Suppose we have a table with 1 million records and a single-level index.

If each index block can hold 100 entries, we would need 10,000 index blocks.

Searching for a record could require reading up to 10,000 disk blocks, which is very slow.

With multilevel indexing, we create a two-level index:

Now, a search only requires reading 1 top-level block + 1 leaf block, reducing disk accesses to just 2–3 reads.