DatabaseManagementSystems3ed,R.RamakrishnanandJ.Gehrke 1
Hash-BasedIndexes
Chapter10
DatabaseManagementSystems3ed,R.RamakrishnanandJ.Gehrke 2
Introduction
- Asforanyindex,3alternativesfordataentriesk*:
Datarecordwithkeyvalue k
✁<k,ridofdatarecordwithsearchkeyvalue k>
✁<k,listofridsofdatarecordswithsearchkeyk>
✂Choiceorthogonaltotheindexingtechnique
- Hash-based indexesarebestforequality selections.
Cannot supportrangesearches.
- Staticanddynamichashingtechniquesexist;
trade-offssimilartoISAMvs.B+trees.
DatabaseManagementSystems3ed,R.RamakrishnanandJ.Gehrke 3
StaticHashing
- #primarypagesfixed,allocatedsequentially,
neverde-allocated;overflowpagesifneeded.
- h(k)modM=buckettowhichdataentrywith
key kbelongs.(M=#ofbuckets)
h(key)modN h key Primarybucketpages Overflowpages 2 N-1