Open In App

Extendible Hashing (Dynamic approach to DBMS)

Extendible Hashing is a dynamic hashing method wherein directories, and buckets are used to hash data. It is an aggressively flexible method in which the hash function also experiences dynamic changes. 

Main features of Extendible Hashing: The main features in this hashing technique are: 



 

Basic Structure of Extendible Hashing: 
 



Frequently used terms in Extendible Hashing: 
 

Basic Working of Extendible Hashing: 
 

 

Example based on Extendible Hashing: Now, let us consider a prominent example of hashing the following elements: 16,4,6,22,24,10,31,7,9,20,26. 
Bucket Size: 3 (Assume) 
Hash Function: Suppose the global depth is X. Then the Hash Function returns X LSBs. 
 

*Notice that the bucket which was underflow has remained untouched. But, since the number of directories has doubled, we now have 2 directories 01 and 11 pointing to the same bucket. This is because the local-depth of the bucket has remained 1. And, any bucket having a local depth less than the global depth is pointed-to by more than one directories.

Key Observations: 
 

  1. A Bucket will have more than one pointers pointing to it if its local depth is less than the global depth.
  2. When overflow condition occurs in a bucket, all the entries in the bucket are rehashed with a new local depth.
  3. If Local Depth of the overflowing bucket
  4. The size of a bucket cannot be changed after the data insertion process begins.

Advantages: 
 

  1. Data retrieval is less expensive (in terms of computing).
  2. No problem of Data-loss since the storage capacity increases dynamically.
  3. With dynamic changes in hashing function, associated old values are rehashed w.r.t the new hash function.

Limitations Of Extendible Hashing: 
 

  1. The directory size may increase significantly if several records are hashed on the same directory while keeping the record distribution non-uniform.
  2. Size of every bucket is fixed.
  3. Memory is wasted in pointers when the global depth and local depth difference becomes drastic.
  4. This method is complicated to code.

Data Structures used for implementation:  

  1. B+ Trees
  2. Array
  3. Linked List

Article Tags :