The Lecture Contains: Hashing Dynamic hashing Extendible hashing Insertion file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_1.htm[6/14/2012 3:34:45 PM]
Single hash function on key Desirable properties of a hash function Uniform: file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_2.htm[6/14/2012 3:34:45 PM]
Single hash function on key Desirable properties of a hash function Uniform: Total domain of keys is distributed uniformly over the range Random: file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_3.htm[6/14/2012 3:34:45 PM]
Single hash function on key Desirable properties of a hash function Uniform: Total domain of keys is distributed uniformly over the range Random: Hash values should be distributed uniformly irrespective of distribution of keys search Example of hash functions: file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_4.htm[6/14/2012 3:34:45 PM]
Single hash function on key Desirable properties of a hash function Uniform: Total domain of keys is distributed uniformly over the range Random: Hash values should be distributed uniformly irrespective of distribution of keys search Example of hash functions: Collision resolution Chaining Load factor Primary pages and overflow pages (or buckets) Search time more for overflow buckets file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_5.htm[6/14/2012 3:34:45 PM]
Single hash function on key Desirable properties of a hash function Uniform: Total domain of keys is distributed uniformly over the range Random: Hash values should be distributed uniformly irrespective of distribution of keys search Example of hash functions: Collision resolution Chaining Load factor Primary pages and overflow pages (or buckets) Search time more for overflow buckets Open addressing Linear probing Quadratic probing Double hashing Cannot support range or knn queries file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_6.htm[6/14/2012 3:34:45 PM]
Hashing Problems of static hashing Fixed size of hash table due to fixed hash function May require rehashing of all keys when chains or overflow buckets are full Dynamic hashing Hash function modified dynamically as number of records grow Needs to maintain determinism Extendible hashing Linear hashing file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_7.htm[6/14/2012 3:34:46 PM]
Dynamic hashing Organize overflow buckets as binary trees m binary trees for m primary pages produces index of primary page Particular access structure for binary trees Family of functions Each produces a bit At level,, take left branch, otherwise right branch Example: bit representation file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_8.htm[6/14/2012 3:34:46 PM]
Extendible hashing Directory of pointers to buckets (leaf pages) Directory has global depth pointers to leaf pages Pointer contains keys starting with bit string Leaf page has local depth Leaf page contains keys starting with bit string file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_9.htm[6/14/2012 3:34:46 PM]
Insertion When leaf page overflows If, leaf page split into two and is incremented for both new leaf pages If, directory doubles in size, is incremented and leaf page splits file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_10.htm[6/14/2012 3:34:46 PM]
file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture9/9_10.htm[6/14/2012 3:34:46 PM]