Вы находитесь на странице: 1из 9

DIRECT

Click to edit Master subtitle style

4/21/12

ACCES S

Description and Organization The direct access file is the another variation of the relative

file. The records are accessed by their record numbers as with the relative file, And the primitive operations are identical with those listed in Summ chapter 4. ary Relative files -allow direct access to each record by using the record number as an address. Direct access file - is asubtitle style method for Click to edit Master very effective retrieving a record given the value of the primary key for the record.

4/21/12

PRIMITIVE OPERATION Append - set the currency pointer to immediately After the last record in the file and writes a new record there

Write next -set the currency pointer to the next record Master subtitle style Click to edit in the file and writes a new record there

4/21/12

Hashing Function Instead of arbitrarily assigning a record number to a record the record number is derived from a primary key by a function Called hashing function Attributes The record numbers it generates from the primary key will be uniformly And randomly distributed over the file.[i.e.,0<H(key)<N] Click to edit Master subtitle style This is essential to prevent records from clustering together in parts of the file. The hashing function must minimize the creation of synonyms. A synonym is defined as a key that hashes to the same record Number as a different key 4/21/12

Overflow file A very simple solution to the synonym problem is to place all of the Synonyms into another or overflow file. If the load factor of the Click to edit Master subtitle style main file is low the proportion of synonyms will be small and the Overflow file may not need much space. 4/21/12 It my be organized in any way

Linear Probing
It would be much more convenient if all the records could be Stored in one file instead of two or more files as when an overflow File is used . there are several ways this can be done. One method is to partition the file into a larger are used for hashed access, and a smaller overflow area. Simply means that when a synonym is identified the file will be searchedto edit Master subtitle style Click forward Open addressing -means that some predictable From the natural address of the record until an empty slot is found sequence of slot is examined, or probed, until an empty one is found.

4/21/12

Rehash ing Is a different method of open addressing for finding An alternate location within the main file for a synonym. It requires tow hashing functions Is another variation of open addressing. The advantage of rehashing is that synonyms are not competing for the same sequence of slot in which to locate. Disadvantage is that consecutive location will nearly always Click to edit Master subtitle style be too far apart for blocking to contribute to a reduction in physical access.

4/21/12

Changing without replacement Is a method that avoid having to examine such large number of Non synonym records. It requires the use of pointers to build a series of linked lists in the file When a record is being added and its natural address is occupied it is added to a linked list whose Head is the record at the natural address . Click to edit Master subtitle style

4/21/12

Chaining with replacement Differs from changing without replacement in that when Inserting a new record.if the slot at the natural address is occupied By a record for which it is not the natural address that record will be relocated To another empty slot so that the new record may be placed at its natural address Click to edit Master subtitle style

4/21/12

Вам также может понравиться