DBMS Topics
Static Hashing
Last Updated : 21 May, 2026
Static hashing uses a fixed number of buckets B. The hash function always maps keys to the same set of B buckets. The number of buckets is chosen at design time and does
Definition
Static hashing uses a fixed number of buckets B. The hash function always maps keys to the same set of B buckets. The number of buckets is chosen at design time and does not change.
Structure
| │ 0 │ | Block ptr │──────► [Rec_A][Rec_H] |
| │ 1 │ | Block ptr │──────► [Rec_B] |
| │ 2 │ | Block ptr │──────► [Rec_C][Rec_I][Rec_J] → [overflow] |
| │ 3 │ | Block ptr │──────► [Rec_D] |
| │ 4 │ | Block ptr │──────► (empty) |
| │ 5 │ | Block ptr │──────► [Rec_E][Rec_K] |
| │ 6 │ | Block ptr │──────► [Rec_F] |
| │ 7 │ | Block ptr │──────► [Rec_G] |
| Bucket 2 is full | overflow chaining used |
Operations
Search (Lookup)
| 4. If not found and overflow exists | follow overflow chain |
| Best case | 1 disk read (record in primary bucket) |
| Worst case | 1 + overflow_chain_length reads |
Insert
Delete
Overflow Chains
When a bucket overflows, a chain of overflow blocks is linked:
Problem with overflow chains: Long chains degrade performance from O(1) to O(n).
Bucket Overflow Causes
- Insufficient buckets: Too few buckets for the number of records
- Skewed distribution: Many keys hash to the same bucket (uneven distribution)
- Bad hash function: Not uniform enough
Load Factor
Load factor α = n / (B × slots_per_bucket)
Choosing Number of Buckets
Advantages and Disadvantages
Advantages
- Very fast equality search: O(1) average
- Simple to implement
- Good performance when data size is known in advance
Disadvantages
| If data grows: overflow chains | slow |
| If data shrinks: many empty buckets | wasted space |
| 4. Bad hash functions | clusters → long overflow chains |
Static Hashing Performance
| Search/Insert/Delete | 1 disk read + O(1) computation = O(1) |
| Search | 1 + (overflow chain length) disk reads |
| As load factor increases | chains grow → performance degrades |
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Static Hashing.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this DBMS topic.
Search Terms
dbms, database management system, database notes, sql, unit, static, hashing, static hashing
Related DBMS Topics