Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In regards to databases, what's a "hash" key ?

Status
Not open for further replies.

qotyebw

Programmer
Aug 24, 2000
103
US
What's the definition of a "hash" key, regarding IDMS, or DBs in general? I know what a key is, but what does "hash" refer to? Anything illegal (LOL)?
 
From Database Systems, Connolly and Begg. The chapter goes into much detail.

("Record" refers to the underlying database file structures. i.e., S/390 DB2 consists of the VSAM file structure, KSDS.)

"In a hash file, records do not have to be written sequentially to a file. Instead, a hash function calculates the address of the page in which the record is to be stored based on one or more of the fields in the record. The base field is called the hash field, or if the field is also a key field of the file, it is called the hash key. Records in a hash file will appear to be randomly distributed across the available file space. For this reason, hash files are sometimes called random, or direct, files."

"The hash function if chosen so that records are as evenly distributed as possible throughout the file."

"The problem with most hashing functions is that they do not guarantee a unique address because the number of possible values a hash field can take is typically much larger than the number of available addresses for records."

"There are several techniques that can be used to manage collisions: Open Addressng, Unchained Overflow, Chained Overflow, Multiple Hashing."





 
Hmmmm. Pages? I'm not into assembler, but I assume you mean that a hash key points to a randomly-accessed record (in a DASD system, of course), as opposed to a record accessed by the relative relationship to another record. Maybe I need to go back to some basics on this...?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top