Parameters in the Extensible Hashing Algorithm
Note:
each physical bucket (disk block)
has its
own
parameter i'
Parameter i:
# bits used in the hash function
Note:
# logical buckets
=
2i
Parameter i' of a physical bucket:
minimum # bits needed
to find keys in this physical bucket
Parameter i' of a physical bucket:
minimum # bits needed
to find keys in this physical bucket
Example:
How many bits in the
hash key do you
need
to find the
search keys in
each physical bucket ?
Parameter i' of a physical bucket:
minimum # bits needed
to find keys in this physical bucket
Example:
Answer in the
figure above...
2 items in the algorithm that we need to discuss....
2 important items of
dicussion in
the Extensible Hashing Algorithm:
- How to update
the physical bucket parameter i'
- How to update
the (golbal) parameter i
|
How to update the parameter i' of a physical bucket
Initial state:
keys in the
physical buckets
hashed using
i' = 2 bits
How to update the parameter i' of a physical bucket
In a physical
bucket split operation,
we will use (i'+1) bits to
split the keys over
2 physical buckets:
How to update the parameter i' of a physical bucket
After the split,
the parameter i' of
each bucket is
set to
i'+1:
How to update the (global) parameter i of Extensible Hashing
Example 1:
initial state
How to update the (global) parameter i of Extensible Hashing
Example 1:
insert a key and
split bucket
How to update the (global) parameter i of Extensible Hashing
Example 1:
we can re-map
logical → physical
to fix the hash index
How to update the (global) parameter i of Extensible Hashing
Example 1:
we can solve a
split
without increasing
the logical bucket size if
new i' ≤ i
How to update the (global) parameter i of Extensible Hashing
Example 2:
initial state
How to update the (global) parameter i of Extensible Hashing
Example 2:
insert a key and
split bucket
How to update the (global) parameter i of Extensible Hashing
Example 2:
we must
increase i (and the
# logical buckets) to
fix the
hash index when
new i' > i !!
The Extensible Hashing Algorithm
We are now ready to present the
Extensible Hashing Algorithm
The
Extensible Hashing Algorithm
is below in this
webpage
❮
❯