This document discusses static hashing techniques for file organization. It explains that hashing provides data access without indexes by computing a function on a search key. Bucket overflow can occur if there are not enough buckets to handle the data, or if a non-uniform hash function leads to skew. Overflow is handled through closed hashing using overflow chaining or open hashing using linear probing, though closed hashing is preferred. The document also notes that hashing is less efficient for range queries than ordered indexing.
Analyze what happens to the market for pizza, if the price of tomato rises an...
Hashing
1.
2. Name ID
Tanzila Islam 2012000000022
Fariha Mahmud 2012000000008
Rumana Yesmin 2012000000078
3. Static Hashing
› File Organization
› Properties of the Hash Function
› Bucket Overflow
› Indices
4. Hashing provides a means for accessing data
without the use of an index structure.
Data is addressed on disk by computing a
function on a search key instead.
5. Bucket
Hash function
Operation: Insertion, deletion, and lookup
are done in constant time.
6. The distribution should be uniform.
The distribution should be random.
7. How does bucket overflow occur?
› Not enough buckets to handle data
› A few buckets have considerably more records
then others. This is referred to as skew.
Multiple records have the same hash value
Non-uniform hash function distribution.
8. Provide more buckets then are needed.
Overflow chaining
› If a bucket is full, link another bucket to it.
Repeat as necessary.
› The system must then check overflow buckets for
querying and updates. This is known as closed
hashing.
9. Open hashing
› The number of buckets is fixed
› Overflow is handled by using the next bucket in
cyclic order that has space.
This is known as linear probing.
Compute more hash functions.
Note: Closed hashing is preferred in database
systems.
10.
11. Hashing is less efficient if queries to the
database include ranges as opposed to
specific values.
In cases where ranges are infrequent hashing
provides faster insertion, deletion, and
lookup then ordered indexing.