Академический Документы
Профессиональный Документы
Культура Документы
Management Systems
<key>
key h(key)
Buckets
(typically 1
disk block)
records
key h(key)
.
record
key h(key) key 1
Index
0
INSERT: d
h(a) = 1 1
a e
h(b) = 2 c
2
b
h(c) = 1
3
h(d) = 0
h(e) = 1
Delete: 0
a
e 1
b d
f c d
2
c e
3
f maybe move
g g up
h(K)[i ] to bucket
10
1 2
1001 11
1010 1100
1 2 New directory
Insert 1100
1010
DBMS 200 Notes 4.2: Hashi 16
Example continued 2
0000
i= 2 0001
00
01
12
0001 0111
10 0111
11 2
1001
1010
Insert:
2
0111 1100
0000
Example:
Walk thru insert example in reverse!
Two ideas:
(a) Use i low order bits of hash b
01110101
grows i
(b) File grows linearly
i = 23
Hashing
- How it works
- Dynamic hashing
- Extensible
- Linear
Indexing vs Hashing
Index definition in SQL