SlideShare a Scribd company logo
4
Most read
6
Most read
10
Most read
EXTENDIBLE HASHING
B.KOHILA
I –Msc(IT)
 Extendible hashing
 Expandable and dynamic hashing
 Virtual hashing
 Summary
2
OUTLINE
3
 Standard hashing works on fixed file size.
 What if we add / delete many keys?
What if the file sizes change significantly?
 Then we will develop separate techniques.
Two types:
- Directory schemes
- Directory less schemes
Hash Functions for Extendible Hashing
4
 Keys stored in buckets.
 Each bucket can only hold a fixed size of items.
 Index is an extendible table;
h(x) hashes a key value x to a bit map;
only a portion of a bit map is used to build a directory.
Example: buckets h(kn) = 11011
Add kn
b00 ********************************
b00
b01 b01
b10
Table
b1 b11
Extendible Hashing
00011
00110
00101
01100
01011
10011
11110
11111
00
01
10
11
00
01
10
11
10011
11011
11110
11111
5
 Directory schemes
- Extendible Hashing (Fagin et. al. 1979)
- Expandable hashing (Knott 1971)
- Dynamic Hashing (Larson 1978)
 Directory less schemes
- Virtual hashing (Litwin 1978)
Hash Functions for Extendible Hashing
6
 Size of a bucket = MAX # of pseudokeys (3 in our example)
 Once the bucket is full –
split the bucket into two
Two situation will be possible:
- Directory remains of the same size
adjust pointer to a bucket
- Size of directory grows from 2k to 2k+1
i.e. directory size can be 1, 2, 4, 8, 16 etc
(8 is shown in the figure).
The number of buckets will remain the same,
i.e. some references will point to the same bucket.
Finally, one can use bitmap to build the index but store an actual key in
the bucket!
Extendible Hashing
000
001
010
011
100
101
110
111
7
1. Use as much space as needed.
2. Input the file name, # of words to insert
Use bucket size: 128
3. Use any function h(k) that returns the string of bits of up to
32 bits (integer type can be used).
4. Bucket – char array
5. Main idea: only the FIRST bits of the mask are used for
search
Extendible Hashing
8
Assume that a hashing technique is applied to a dynamically changing file
composed of buckets, and each bucket can hold only a fixed number of items.
Extendible hashing accesses the data stored in
buckets indirectly through an index that is
dynamically adjusted to reflect changes in the file.
The characteristic feature of extendible hashing is the organization of the
index, which is an expandable table.
Extendible Hashing
9
 A hash function applied to a certain key indicates a position in the index
and not in the file (or table or keys). Values returned by such a hash
function are called pseudokeys.
 The file requires no reorganization when data are added to or deleted
from it, since these changes are indicated in the index.
Only one hash function h can be used, but depending on the size of the
index, only a portion of the added h(K) is utilized.
 A simple way to achieve this effect is by looking at the address into the
string of bits from which only the i leftmost bits can be used.
The number i is the depth of the directory.
In figure 1(a) (in the next slide), the depth is equal to two.
Extendible Hashing
10
Extendible Hashing
Figure 1. An example of extendible hashing
(Drozdek Textbook)
11
Expandable Hashing
 Similar idea to an extendible hashing.
But binary tree is used to store an index on the buckets.
Dynamic Hashing
 multiple binary trees are used.
Outcome:
- To shorten the search.
- Based on the key --- select what tree to search.
Expandable & Dynamic Hashing
12
 Larson method
 Index is simplified to be represented as a set of binary
trees.
 Height of each tree is limited.
 h(x) is searched in ALL trees.
Time: m – trees, k keys in each max, overall: m*lgk.
Advantage: shorter search time in index file
Dynamic Hashing
13
Litwin’s Virtual Hashing
 Expand buckets in a linear fashion.
 Store them continuously in the memory.
 No table is needed, the procedure is simple.
Virtual Hashing
14
Summary
 Extendible hashing advantages:
 Initially allocated space can increase indefinitely
 Location of a bucket where key belongs requires only very fast bits
comparison
 Very flexible in choosing size of the bucket, and allows their storage on
disks/remote memory access
 Extendible hashing disadvantages:
 Increased algorithm complexity
 Extra memory overhead to store index inside the bucket

More Related Content

What's hot (20)

PPTX
Breadth First Search & Depth First Search
Kevin Jadiya
 
PPTX
Tree - Data Structure
Ashim Lamichhane
 
PPTX
Hashing in datastructure
rajshreemuthiah
 
PPSX
Data Structure (Queue)
Adam Mukharil Bachtiar
 
PPTX
Binary Tree Traversal
Dhrumil Panchal
 
PPTX
STACKS IN DATASTRUCTURE
Archie Jamwal
 
PPTX
Threaded Binary Tree
khabbab_h
 
PPTX
stack & queue
manju rani
 
PPT
Joins in SQL
Vigneshwaran Sankaran
 
PPT
Binary search tree(bst)
Hossain Md Shakhawat
 
PPT
Data structures using c
Prof. Dr. K. Adisesha
 
PPTX
Binary Search Tree in Data Structure
Dharita Chokshi
 
PPTX
Queue ppt
SouravKumar328
 
PPTX
Half adder and full adder
SanjuktaBanik
 
PPTX
Structure of the page table
duvvuru madhuri
 
PPTX
linked list in data structure
shameen khan
 
PPT
1.1 binary tree
Krish_ver2
 
PPTX
Project of data structure
Umme habiba
 
PPT
12. Indexing and Hashing in DBMS
koolkampus
 
PPT
B trees in Data Structure
Anuj Modi
 
Breadth First Search & Depth First Search
Kevin Jadiya
 
Tree - Data Structure
Ashim Lamichhane
 
Hashing in datastructure
rajshreemuthiah
 
Data Structure (Queue)
Adam Mukharil Bachtiar
 
Binary Tree Traversal
Dhrumil Panchal
 
STACKS IN DATASTRUCTURE
Archie Jamwal
 
Threaded Binary Tree
khabbab_h
 
stack & queue
manju rani
 
Joins in SQL
Vigneshwaran Sankaran
 
Binary search tree(bst)
Hossain Md Shakhawat
 
Data structures using c
Prof. Dr. K. Adisesha
 
Binary Search Tree in Data Structure
Dharita Chokshi
 
Queue ppt
SouravKumar328
 
Half adder and full adder
SanjuktaBanik
 
Structure of the page table
duvvuru madhuri
 
linked list in data structure
shameen khan
 
1.1 binary tree
Krish_ver2
 
Project of data structure
Umme habiba
 
12. Indexing and Hashing in DBMS
koolkampus
 
B trees in Data Structure
Anuj Modi
 

Similar to Extensible hashing (20)

PPTX
Lecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptx
ROHIT738213
 
PDF
Assignment#12
Sunita Milind Dol
 
PPTX
Hash Table.pptx
MBablu1
 
PPTX
Introduction-to-Extendable -Hashing.pptx
enagathalachaithanya
 
PPT
INDEXING AND HASHING UNIT 4 SILBERSCHATZ
sathiyabcsbs
 
PPT
Hashing gt1
Gopi Saiteja
 
PPTX
DT-08-Hashing.PPTX
BhuvanBalan1
 
PPTX
Unit4 Part3.pptx
KPRevathiAsstprofITD
 
PDF
Hash
zhaolinjnu
 
PPTX
B tree
Padma Kannan
 
PPTX
Hashing_UNIT2.pptx
Samatha Korukonda
 
PPTX
FS-Mod5.pptx
PurushottamPurshi
 
PPTX
Hashing Techniques in database management systems
SheebaS25
 
PPTX
23_Hashing Techniques.pptx sndueiejbeueiebsh
svaru200
 
PDF
DataBaseManagementSystems-BTECH--UNIT-5.pdf
Uma Kakarlapudi
 
PPTX
UNIT-V-hashing and its techniques ppt.pptx
Uma Kakarlapudi
 
PPTX
hashing in data structures and its applications
manjeshbngowda
 
PPT
4.4 hashing ext
Krish_ver2
 
PPTX
Hashing
Aafaqueahmad Khan
 
PDF
DBMS 9 | Extendible Hashing
Mohammad Imam Hossain
 
Lecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptx
ROHIT738213
 
Assignment#12
Sunita Milind Dol
 
Hash Table.pptx
MBablu1
 
Introduction-to-Extendable -Hashing.pptx
enagathalachaithanya
 
INDEXING AND HASHING UNIT 4 SILBERSCHATZ
sathiyabcsbs
 
Hashing gt1
Gopi Saiteja
 
DT-08-Hashing.PPTX
BhuvanBalan1
 
Unit4 Part3.pptx
KPRevathiAsstprofITD
 
B tree
Padma Kannan
 
Hashing_UNIT2.pptx
Samatha Korukonda
 
FS-Mod5.pptx
PurushottamPurshi
 
Hashing Techniques in database management systems
SheebaS25
 
23_Hashing Techniques.pptx sndueiejbeueiebsh
svaru200
 
DataBaseManagementSystems-BTECH--UNIT-5.pdf
Uma Kakarlapudi
 
UNIT-V-hashing and its techniques ppt.pptx
Uma Kakarlapudi
 
hashing in data structures and its applications
manjeshbngowda
 
4.4 hashing ext
Krish_ver2
 
DBMS 9 | Extendible Hashing
Mohammad Imam Hossain
 
Ad

More from rajshreemuthiah (20)

PPTX
oracle
rajshreemuthiah
 
PPTX
quality
rajshreemuthiah
 
PPTX
bigdata
rajshreemuthiah
 
PPTX
polymorphism
rajshreemuthiah
 
PPTX
solutions and understanding text analytics
rajshreemuthiah
 
PPTX
interface
rajshreemuthiah
 
PPTX
Testing &ampdebugging
rajshreemuthiah
 
PPTX
concurrency control
rajshreemuthiah
 
PPTX
Education
rajshreemuthiah
 
PPTX
Formal verification
rajshreemuthiah
 
PPTX
Transaction management
rajshreemuthiah
 
PPTX
Multi thread
rajshreemuthiah
 
PPTX
System testing
rajshreemuthiah
 
PPTX
software maintenance
rajshreemuthiah
 
PPTX
exception handling
rajshreemuthiah
 
PPTX
e governance
rajshreemuthiah
 
PPTX
recovery management
rajshreemuthiah
 
PPTX
Implementing polymorphism
rajshreemuthiah
 
PPSX
Buffer managements
rajshreemuthiah
 
PPTX
os linux
rajshreemuthiah
 
polymorphism
rajshreemuthiah
 
solutions and understanding text analytics
rajshreemuthiah
 
interface
rajshreemuthiah
 
Testing &ampdebugging
rajshreemuthiah
 
concurrency control
rajshreemuthiah
 
Education
rajshreemuthiah
 
Formal verification
rajshreemuthiah
 
Transaction management
rajshreemuthiah
 
Multi thread
rajshreemuthiah
 
System testing
rajshreemuthiah
 
software maintenance
rajshreemuthiah
 
exception handling
rajshreemuthiah
 
e governance
rajshreemuthiah
 
recovery management
rajshreemuthiah
 
Implementing polymorphism
rajshreemuthiah
 
Buffer managements
rajshreemuthiah
 
os linux
rajshreemuthiah
 
Ad

Recently uploaded (20)

PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 

Extensible hashing

  • 2.  Extendible hashing  Expandable and dynamic hashing  Virtual hashing  Summary 2 OUTLINE
  • 3. 3  Standard hashing works on fixed file size.  What if we add / delete many keys? What if the file sizes change significantly?  Then we will develop separate techniques. Two types: - Directory schemes - Directory less schemes Hash Functions for Extendible Hashing
  • 4. 4  Keys stored in buckets.  Each bucket can only hold a fixed size of items.  Index is an extendible table; h(x) hashes a key value x to a bit map; only a portion of a bit map is used to build a directory. Example: buckets h(kn) = 11011 Add kn b00 ******************************** b00 b01 b01 b10 Table b1 b11 Extendible Hashing 00011 00110 00101 01100 01011 10011 11110 11111 00 01 10 11 00 01 10 11 10011 11011 11110 11111
  • 5. 5  Directory schemes - Extendible Hashing (Fagin et. al. 1979) - Expandable hashing (Knott 1971) - Dynamic Hashing (Larson 1978)  Directory less schemes - Virtual hashing (Litwin 1978) Hash Functions for Extendible Hashing
  • 6. 6  Size of a bucket = MAX # of pseudokeys (3 in our example)  Once the bucket is full – split the bucket into two Two situation will be possible: - Directory remains of the same size adjust pointer to a bucket - Size of directory grows from 2k to 2k+1 i.e. directory size can be 1, 2, 4, 8, 16 etc (8 is shown in the figure). The number of buckets will remain the same, i.e. some references will point to the same bucket. Finally, one can use bitmap to build the index but store an actual key in the bucket! Extendible Hashing 000 001 010 011 100 101 110 111
  • 7. 7 1. Use as much space as needed. 2. Input the file name, # of words to insert Use bucket size: 128 3. Use any function h(k) that returns the string of bits of up to 32 bits (integer type can be used). 4. Bucket – char array 5. Main idea: only the FIRST bits of the mask are used for search Extendible Hashing
  • 8. 8 Assume that a hashing technique is applied to a dynamically changing file composed of buckets, and each bucket can hold only a fixed number of items. Extendible hashing accesses the data stored in buckets indirectly through an index that is dynamically adjusted to reflect changes in the file. The characteristic feature of extendible hashing is the organization of the index, which is an expandable table. Extendible Hashing
  • 9. 9  A hash function applied to a certain key indicates a position in the index and not in the file (or table or keys). Values returned by such a hash function are called pseudokeys.  The file requires no reorganization when data are added to or deleted from it, since these changes are indicated in the index. Only one hash function h can be used, but depending on the size of the index, only a portion of the added h(K) is utilized.  A simple way to achieve this effect is by looking at the address into the string of bits from which only the i leftmost bits can be used. The number i is the depth of the directory. In figure 1(a) (in the next slide), the depth is equal to two. Extendible Hashing
  • 10. 10 Extendible Hashing Figure 1. An example of extendible hashing (Drozdek Textbook)
  • 11. 11 Expandable Hashing  Similar idea to an extendible hashing. But binary tree is used to store an index on the buckets. Dynamic Hashing  multiple binary trees are used. Outcome: - To shorten the search. - Based on the key --- select what tree to search. Expandable & Dynamic Hashing
  • 12. 12  Larson method  Index is simplified to be represented as a set of binary trees.  Height of each tree is limited.  h(x) is searched in ALL trees. Time: m – trees, k keys in each max, overall: m*lgk. Advantage: shorter search time in index file Dynamic Hashing
  • 13. 13 Litwin’s Virtual Hashing  Expand buckets in a linear fashion.  Store them continuously in the memory.  No table is needed, the procedure is simple. Virtual Hashing
  • 14. 14 Summary  Extendible hashing advantages:  Initially allocated space can increase indefinitely  Location of a bucket where key belongs requires only very fast bits comparison  Very flexible in choosing size of the bucket, and allows their storage on disks/remote memory access  Extendible hashing disadvantages:  Increased algorithm complexity  Extra memory overhead to store index inside the bucket