Linear hashing in dbms pdf. The bucket is said to have p slots.
Linear hashing in dbms pdf An alternative approach that is moreincrementalto its work is that of linear hashing [4]. Linear Hashing Overview The hash table can be implemented either using Buckets: An array is used for implementing the hash table. 9. Explain the steps we go through when the following hashes are added (in order): 5; 7; 12; 11; 9. nDirectory avoided in LH by using temporary overflow pages, and choosing the bucket to split in a round-robinfashion. JAN 2021 LINEAR-HASHING Slide 11 Linear Hashing • This is another dynamic hashing scheme, an alternative to Extendible Hashing. The array has size m*p where m is the number of hash values and p (≥ 1) is the number of slots (a slot can hold one entry) as shown in figure below. The bucket is said to have p slots. • Idea: Use a family of hash functions h 0, h 1, h 2, – h i (key) = h (key) mod(2 i N); N = initial Linear Hashing nA dynamic hashing scheme that handles the problem of long overflow chains without using a directory. However, when n grows to be of certain (large) size, doubling up what is already in place does represent much wasted space in the structure. nWhen anybucket overflows split the bucket that is currently pointed to by the “Next” double the size of the hash-table. • LH handles the problem of long overflow chains without using a directory, and handles duplicates. This is the main idea behind extensible hashing [1]. 0 1st slot 1 2 3 key Hash value (index) 2nd slot key The growth rate of the bucket array will be linear (hence its name) The decision to increase the size of the bucket array is exible A commonly used criteria is: If (the average occupancy per bucket > some threshold) then split one bucket into two Linear hashing uses overflow buckets Use the i low-order bits from the result of the hash function to 1) formula h() for hashing function 2) size of hash table M 3) collision resolution method CMU SCS Faloutsos CMU SCS 15-415/615 11 Design decisions - functions • Goal: uniform spread of keys over hash buckets • Popular choices: – Division hashing – Multiplication hashing CMU SCS Faloutsos CMU SCS 15-415/615 12 Division hashing • Suppose that we are using linear hashing, and start with an empty table with 2 buckets (M = 2), split = 0 and a load factor of 0. eaqnmubmruolkchvhemcjktrhtdfqlanzdrhzohdnknqufmyoblz