Static Hash Functions



next up previous
Next: Dynamic Hash Functions Up: Indexing & Hashing Previous: B-Tree Index Files

Static Hash Functions

  1. Index schemes force us to traverse an index structure. Hashing avoids this. Hashing involves computing the address of a data item by computing a function on the search key value.

    A hash function h is a function from the set of all search key values to the set of all bucket addresses .

  2. Ideally, distribution of keys to addresses is uniform and random.

  3. Suppose we have 26 buckets, and map names beginning with th letter of the alphabet to the th bucket.
  4. Insertion and deletion are simple.

  5. Open hashing occurs where records are stored in different buckets. Compute the hash function and search the corresponding bucket to find a record. Closed hashing occurs where all records are stored in one bucket. Hash function computes addresses within that bucket. (Deletions are difficult.) Not used much in database applications.

  6. Drawback to our approach: Hash function must be chosen at implementation time.



next up previous
Next: Dynamic Hash Functions Up: Indexing & Hashing Previous: B-Tree Index Files



Page created and maintained by Osmar R. Zaï ane
Last Update: Wed Nov 15 11:12:38 PST 1995