Example:
We need only read 1 disk block to find any search key
We may need to read
to find some search keys !!!!
Hash( key ) = random( key ) % B
Explanation:
(This spread the keys more uniformly over the range [0 .. (B−1)])
(Because computing % 10 is easy)
We use the following simple hash function:
Hash(x) = x%10
Sample of the hash table content:
We must use a different hash function that covers the wider range !!!
For example:
Hash(x) = x % 20
Result:
Consequence:
Solving the "can't find the search key" problem:
However: