The traditional hashing technique
Hash index
identifies
the hash bucket
directly
The extensible hashing technique
Hash index
identifies
the hash bucket
indirectly
through a mapping table
The extensible hashing technique
The effect of
changing (doubling)
the hash function range:
The extensible hashing technique
The effect of
changing (doubling)
the hash function range:
Notice that the
physical bucket array size
has
not changed (still 10 buckets) !!!
The extensible hashing technique
We can map the
additional logical hash buckets
to
the physical hash buckets as follows:
Notice the
mapping
will preserve the
outcome of the
old hash function !!!
The extensible hashing technique
We can map the
additional logical hash buckets
to
the physical hash buckets as follows:
In other words:
we
do not need to
rehash any key
when we change the
hash function !!!
Gradual increase in the
physical buck size
Suppose we
insert a
seearch key into
a full hash bucket:
Traditionally,
we
resolve the
overflow using
a overflow disk block to
store the new search key
Gradual increase in the
physical buck size
ALternative way
to resolve overflow: (1)
increase the
physical bucket array
We rehash the
keys in the overflow bucket
into 2 physical buckets
using the new hash function
Gradual increase in the
physical buck size
ALternative way
to resolve overflow: (2)
remap the
logical → physical bucket array
Notice the
larger hash range
is correct
(without having to
rehash
all search keys) !!
❮
❯