- C. Faloutsos
CMU - 15-415 1
Carnegie Mellon
Carnegie Mellon Univ.
- Dept. of Computer Science
15-415 - Database Applications
- C. Faloutsos
Indexing and Hashing – part II
15-415 - C. Faloutsos 2 Carnegie Mellon
General Overview - rel. model
- Relational model - SQL
– Formal & commercial query languages
- Functional Dependencies
- Normalization
- Physical Design
- Indexing
15-415 - C. Faloutsos 3 Carnegie Mellon
Indexing- overview
- ISAM and B-trees
- hashing
- Hashing vs B-trees
- Indices in SQL
- Advanced topics:
– dynamic hashing – multi-attribute indexing
15-415 - C. Faloutsos 4 Carnegie Mellon
(Static) Hashing
Problem: “find EMP record with ssn=123” What if disk space was free, and time was at premium?
15-415 - C. Faloutsos 5 Carnegie Mellon
Hashing
A: Brilliant idea: key-to-address transformation:
#0 page #123 page #999,999,999
123; Smith; Main str
15-415 - C. Faloutsos 6 Carnegie Mellon
Hashing
Since space is NOT free:
- use M, instead of 999,999,999 slots
- hash function: h(key) = slot-id
#0 page #123 page
#999,999,999
123; Smith; Main str