DatabaseManagementSystems3ed,R.RamakrishnanandJohannesGehrke 1
EvaluationofRelationalOperations: OtherTechniques
Chapter12,PartB
DatabaseManagementSystems3ed,R.RamakrishnanandJohannesGehrke 2
UsinganIndexforSelections
- Costdependson#qualifyingtuples,andclustering.
Costoffindingqualifyingdataentries(typicallysmall)plus costofretrievingrecords(couldbelargew/oclustering).
✁Inexample,assuminguniformdistributionofnames,about 10%oftuplesqualify(100pages,10000tuples).Witha clusteredindex,costislittlemorethan100I/Os;if unclustered,upto10000I/Os!
- Importantrefinementforunclusteredindexes:
1.Findqualifyingdataentries. 2.Sorttherid’softhedatarecordstoberetrieved. 3.Fetchridsinorder.Thisensuresthateachdatapageis lookedatjustonce(though#ofsuchpageslikelytobe higherthanwithclustering).
DatabaseManagementSystems3ed,R.RamakrishnanandJohannesGehrke 3
TwoApproachestoGeneralSelections
- Firstapproach: Findthemostselectiveaccesspath,