5.10 B-Trees
An index maps field values to record ids.
- Record id = [page-id, offset-within-page]
- Most common DB index structures: hashing and B-trees
- DB index structures are page-oriented
Hashing uses a function H:V?B, from field values to block numbers.
- V = social security numbers. B = {1 .. 1000}H(v) = v mod 1000
- If a page overflows, then use an extra overflow page
- At 90% load on pages, 1.2 block accesses per request!
- BUT, doesn’t help for key range access (10 < v < 75)