Extendible Hashing
 Suppose that g=2 and bucket size = 3.
 Suppose that we have records with these keys and hash function
h(key) = key mod 64:
1111 23 010111
3333 5 000101
1235 19 010011
2378 10 001010
1212 60 111100
1456 48 110000
2134 22 010110
2345 41 101001
1111 23 010111
8231 39 100111
2222 46 101110
9999 15 001111
key h(key) = key mod 64 bit pattern
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
00
01
10
11
g=2
l=2
l=2
l=2
l=2
global depth is 2
local depth is 2 and bucket size is 3
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
00
01
10
11
g=2
l=2
l=2
l=2
l=2
1111
110111
11
1111
000101
00
01
10
11
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
g=2
l=2
l=2
l=2
1111
l=2
3333
01
3333
00
01
10
11
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
g=2
l=2
3333
l=2
l=2
1111
l=2
1235
010011
1235
11
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
00
01
10
11
g=2
1212 1456
l=2
3333 2345
l=2
2378 2134
l=2
1111 1235 1111
l=2
00
01
10
11
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
g=2
1212 1456
l=2
3333 2345
l=2
2378 2134
l=2
1111 1235 1111
l=2
8231
100111
11
Bucket overflow occurs. As g = l,
directory structure is doubled.
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
00
01
10
11
g=3
1212 1456
l=2
3333 2345
l=2
2378 2134
l=2
1111 1235 1111
l=2
00
01
10
11
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
000
001
010
011
g=3
1212 1456
l=2
3333 2345
l=2
2378 2134
l=2
l=2
100
101
110
111
l=3
l=3
1111 1235 1111
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
000
001
010
011
g=3
1212 1456
l=2
3333 2345
l=2
2378 2134
l=2
1235
l=2
100
101
110
111
1111 1111
l=3
l=3
8231
100111
111
8231
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
000
001
010
011
g=3
1212 1456
l=2
3333 2345
l=2
2378 2134
l=2
1235
l=2
100
101
110
111
1111 1111 8211
l=3
l=3
2222
101110
110
2222
1111 3333 1235 2378 1212 1456 2134 2345 1111 8231 2222 9999
000
001
010
011
g=3
1212 1456
l=2
3333 2345
l=2
2378 2134
l=2
1235
l=2
100
101
110
111
1111 1111 8211
l=3
l=3
9999
001111
111
Bucket overflow occurs again. As g = l,
directory structure should be doubled
again and same process will repeat.

Extendible hashing

  • 1.
    Extendible Hashing  Supposethat g=2 and bucket size = 3.  Suppose that we have records with these keys and hash function h(key) = key mod 64: 1111 23 010111 3333 5 000101 1235 19 010011 2378 10 001010 1212 60 111100 1456 48 110000 2134 22 010110 2345 41 101001 1111 23 010111 8231 39 100111 2222 46 101110 9999 15 001111 key h(key) = key mod 64 bit pattern
  • 2.
    1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 00 01 10 11 g=2 l=2 l=2 l=2 l=2 global depth is 2 local depth is 2 and bucket size is 3
  • 3.
    1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 00 01 10 11 g=2 l=2 l=2 l=2 l=2 1111 110111 11 1111
  • 4.
    000101 00 01 10 11 1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 g=2 l=2 l=2 l=2 1111 l=2 3333 01 3333
  • 5.
    00 01 10 11 1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 g=2 l=2 3333 l=2 l=2 1111 l=2 1235 010011 1235 11
  • 6.
    1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 00 01 10 11 g=2 1212 1456 l=2 3333 2345 l=2 2378 2134 l=2 1111 1235 1111 l=2
  • 7.
    00 01 10 11 1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 g=2 1212 1456 l=2 3333 2345 l=2 2378 2134 l=2 1111 1235 1111 l=2 8231 100111 11 Bucket overflow occurs. As g = l, directory structure is doubled.
  • 8.
    1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 00 01 10 11 g=3 1212 1456 l=2 3333 2345 l=2 2378 2134 l=2 1111 1235 1111 l=2 00 01 10 11
  • 9.
    1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 000 001 010 011 g=3 1212 1456 l=2 3333 2345 l=2 2378 2134 l=2 l=2 100 101 110 111 l=3 l=3 1111 1235 1111
  • 10.
    1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 000 001 010 011 g=3 1212 1456 l=2 3333 2345 l=2 2378 2134 l=2 1235 l=2 100 101 110 111 1111 1111 l=3 l=3 8231 100111 111 8231
  • 11.
    1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 000 001 010 011 g=3 1212 1456 l=2 3333 2345 l=2 2378 2134 l=2 1235 l=2 100 101 110 111 1111 1111 8211 l=3 l=3 2222 101110 110 2222
  • 12.
    1111 3333 12352378 1212 1456 2134 2345 1111 8231 2222 9999 000 001 010 011 g=3 1212 1456 l=2 3333 2345 l=2 2378 2134 l=2 1235 l=2 100 101 110 111 1111 1111 8211 l=3 l=3 9999 001111 111 Bucket overflow occurs again. As g = l, directory structure should be doubled again and same process will repeat.