Goal: Perform binary search (or some algorithm) on an index for more efficiency
An index is computed separately from the table An index uses a key (like the primary one for a table, or a different one)
Types of sequential file organization
Basically just the file organization tree or whatever structure (e.g. bucket to table) Records stored in sequential order (like a sorted list)
- Dense - index entry for each record
- Sparse - index entry for some records (point to block, not records), extracted
- hash into buckets based on key
Types of indexing
- Clustered - stored in one index file, sorted, any key (typically non primary)
- Primary - primary key, corresponds to a block of records
- Non-clustered - just references to values (data is in leaf nodes), dense organization, idk when this should be used
- Multi-level - add more extractions (grow tree height)
Pros
- Fast search
Cons
- Slower write/update
- more storage space
Common Scenarios
- Lookup is slow. How can it be sped up?