
|
Random
Access
Access may be Random where the key value is programmatically transformed
(randomised/hashed), to convert it to a specific location (address). Access is direct.
The same key value always converts to the same location.
Records all have same length
Access is very fast. To compute the record position in the
file only needs a computation using a formula such as;
(file_start_position + (record_number - 1) * record_length)
Records have no order
All (blank) records must be created when the file is
created, and will contain many holes.
Note: Contention may occur - where two records hash to the
same location.(Handled using a bucket for overflowing records. If the bucket becomes too
large the hashing algorithm needs to be revised).
Examples:
- Divide key by prime number
- Extract selected characters from key
- With a numeric key, divide the key by the size of the file
and use the remainder (+1) to get the location.
|