Improving the secondary index structure III: Solution 2
Method: each secondary key points to a different list of primary key references. Each of these lists could grow to be as long as it needs to be and no space would be lost to internal fragmentation.
Advantages:
- The secondary index file needs to be rearranged only upon record addition.
- The rearranging is faster.
- It is not that costly to keep the secondary index on disk.
- The primary index never needs to be sorted.
- Space from deleted primary index records can easily be reused.
Disadvantage:
- Locality (in the secondary index) has been lost ==> More . seeking may be necessary.