3 Feb 2020

  • February 03, 2020
  • Amitraj
Dynamic Hashing

-> The dynamic hashing method is used to overcome the problems of static hashing like bucket overflow.

-> In this method, data buckets grow or shrink as the records increases or decreases. This method is also known as Extendable hashing method.

-> This method makes hashing dynamic, i.e., it allows insertion or deletion without resulting in poor performance.




How to search a key

1. First, calculate the hash address of the key.

2. Check how many bits are used in the directory, and these bits are called as i.

3. Take the least significant i bits of the hash address. This gives an index of the directory.

4. Now using the index, go to the directory and find bucket address where the record might be.




How to insert a new record

1. Firstly, you have to follow the same procedure for retrieval, ending up in some bucket.

2. If there is still space in that bucket, then place the record in it.

3. If the bucket is full, then we will split the bucket and redistribute the records.



For example:
Consider the following grouping of keys into buckets, depending on the prefix of their hash address:





The last two bits of 2 and 4 are 00. So it will go into bucket B0. The last two bits of 5 and 6 are 01, so it will go into bucket B1. The last two bits of 1 and 3 are 10, so it will go into bucket B2. The last two bits of 7 are 11, so it will go into B3.







Hashing is not favorable when the data is organized in some ordering and the queries require a range of data. When data is discrete and random, hash performs the best.

-> Hashing algorithms have high complexity than indexing. All hash operations are done in constant time.





Advantages Of  Dynamic Hashing

1. In this method, memory is well utilized as it grows and shrinks with the data. There will not be any unused memory lying.

2. This method is good for the dynamic database where data grows and shrinks frequently.




Disadvantages Of  Dynamic Hashing


1. In this case, the bucket overflow situation will also occur. But it might take little time to reach this situation than static hashing.

Related Posts:

  • Three Generations Of DBMS Simplistically, the three generations are pre-relational, relational and post-relational. 1. The first wave of digital database systems emerged shortly after magnetic disk became widely available. They supported network an… Read More
  • DBMS Aggregation Aggregation - In aggregation, the relation between two entities is treated as a single entity. In aggregation, relationship with its corresponding entities is aggregated into a higher level entity. eg:  Center entity … Read More
  • DBMS Convert ER Into Table Reduction of ER diagram to Table - -> ER diagram is converted into the tables in relational model. -> This is because relational models can be easily implemented by RDBMS like MySQL , Oracle etc. -> The database… Read More
  • What are Advantages & Disadvantages Of ER Model ? Advantages Of ER Model:- 1. ER model is simple and easily understanble. It is represented in business users language and it can be understood by non-technical specialist. 2. Straightforward relation representation. 3… Read More
  • Various Symbols Used In ER Diagram : Notation of ER diagram In DBMS Various Symbols Used In ER Diagram - Entity Simple rectangular box represents an Entity. Relationships between Entities - Weak and Strong Rhombus is used to setup relationships between two or more entities. A… Read More

Translate

Popular Posts