General characteristics of an index : An Outline
Issue to consider in any index structure(not just B+-trees)
- Query support : what class of queries does the index allow?
- Choice of Search Key(Affects the queries for which we can use an index)
- Data Entry Storage(Affects performance of the index)
- Variable -length key tricks (Affects performance of the index)
- Cost Model for Index vs Heap vs Stored File
Query support
Part 3 Composite Search Keys in One Dimension
Search Key and Ordering
Data Entry Storage Intro
- What is the representation of data in the index?(Actual data or pointer to the data)
- How is the data stored in the data file?(Clustered or unclustered with respect to the index)
- Big Impact on Performance
Three basic alternatives for data entries in any index
- Three basic alternatives for data entries in any index
- Alternative 1: By Value
- Alternative 2: By Reference
- Alternative 3: By List of references
Alternative 1 Index (B+ Tree)
Record content are stored in the index file
No need to follow pointers
Alternative 2 Index
Alternative 2: By Reference , <k, rid of matching data record>
We used in slides above.
Alternative 3 Index
Alternative 3: By List of references , <k, list of rids of matching data records>
Alternative 3 more compact than alternative 2
For very large rid lists ,single data entry spans multiples blocks.
Indexing By Reference
Both Alternative 2 and Alternative 3 index data by reference
By-reference is required to support multiple indexes per table
Otherwise we would be replicating entire tuples
Replicating data leads to complexity when we're doing updates ,so it's something we want to avoid.
Part 5 Clustered vs Unclustered Indexes
Part6 Variable Length Keys : Occupancy and Compression
Lec8 Part1 Intro to Buffer Management