Friday, November 12, 2010

FILE ORGANIZATION NOTES

FILE ORGANIZATION
A file is a sequence of records that are mapped onto disk block. A file organization means the way of arranging records in a file when a file stored on disk.
A file organization is though of as consisting of two parts:
1.     A data structure
2.     An access method

Sequential Access Method
Sequential Access Method is those that access the components of a file in order. There are two Sequential Access Method
1.     Physically sequential file
2.      Physically linked sequential file

Physically sequential file
A Physically sequential file which often called just Sequential file, places the components of the file in contiguous storage thus this access method uses storage efficiently. Physically sequential file can be ordered or un-ordered types.
          An order sequential file has a key and components of the file are kept in order of the key.
          A un-order sequential file simply adds components as they are received.

Physically linked sequential file
Physically linked sequential files use a pointer to keep the components of the file in sequence. Physically linked sequential file are usually ordered. These file are typically used to make insertion and deletion more efficient but they do not storage as efficient as sequential file. Sequential file can access records faster then physically linked sequential file.

Access Operation
Access operation is split into three major categories.
1. Retrieval operation
2. Insertion operation
3. Deletion operation

Direct Access Method
Direct Access Method can access any components of the file directly; they do not need to follow any order. For this reason they are also called random access method. As Direct Access Method allow a component of the file to be access directly, these need to be a unique key. Direct access methods are split into two categories:
1. Address calculation method
2. Search method

Address calculation method
Address calculation method use a function procedure to calculate the address from the key. This provides fast access without using storage, but less flexibility. This is the simplest methods because there is no calculation involved. But it involved wastage of a lot of storage because there must be storage for every potential key where it is used or not. Files that use this access method are called direct file. Direct file provide fast access, but waste a lot of storage space.

Search method
Search method provides a means of storing information about the keys, so that address can be arbitrarily assigned to keys. This provides for a greater flexibility but it has slower access and it is less efficient in storage utilization. One common search method is sequential search.

Index Sequential Method
Index sequential methods are a compromise between sequential and direct access methods. Sequential access is more storage efficient. Direct access has the fastest access. But Index Sequential is a combination of both as storage efficient as sequential access and as fast access as direct access.
They are tow types:
1. ISAM (Index sequential access method)
2. VSAM (Virtual sequential Access Method).

No comments: