Hashing in physical file organization: does a hashing algorithm convert a primary key value into a record (bucket) address?

Database Physical Database Design Difficulty: Easy
Choose an option
  • A
    Valid — hashing maps key values to bucket/record addresses
  • B
    Invalid — hashing only compresses keys for storage
  • C
    Valid only for secondary indexes
  • D
    Valid exclusively in distributed systems
  • E
    Valid only when the key is numeric

Answer

Correct Answer: Valid — hashing maps key values to bucket/record addresses

Explanation

Introduction / Context:Hash-based file organizations and hash indexes are used to provide near O(1) access by transforming a search key into an address for storage and retrieval.

Given Data / Assumptions:

  • A hash function h(key) produces a bucket/page address or slot identifier.
  • Collisions are handled via chaining, open addressing, or overflow areas.
  • The key can be any datatype that the hash function can process (not only numeric).

Concept / Approach:The statement accurately reflects primary-key hashing used in static or dynamic hashing schemes to compute a record's home location.

Step-by-Step Solution:Define hash function: h(k) → address.Apply to primary key to get target bucket.Handle collisions if multiple keys map to the same address.Retrieve or insert the record at that location.

Verification / Alternative check:Standard database textbooks describe hashing as address computation from keys.

Why Other Options Are Wrong:Hashing is not mere compression, nor limited to secondary indexes, distributed systems, or numeric keys.

Common Pitfalls:Ignoring collision handling and bucket overflow management in design.

Final Answer:Valid — hashing maps key values to bucket/record addresses

Discussion & Comments
No comments yet. Be the first to comment!
Join Discussion