File Flashcards
File
A file is named collection of related information that is recorded on secondary storage such as magnetic disks, magnetic tables and optical disks.
What is File Organization?
Storing the files in certain order is called file Organization.
File Organization refers to the logical relationships among various records that constitute the file, particularly with respect to the means of identification and access to any specific record.
File Structure
refers to the format of the label and data blocks and of any logical control record.
Types of File Organizations
it is all upon the programmer to decide the best suited file Organization method according to his requirements.
Some are: Sequential File Organization Heap File Organization Hash File Organization B+ Tree File Organization Clustered File Organization
Sequential File Organization
The easiest method for File Organization is Sequential method.
In this method the file are stored one after another in a sequential manner.
two of Sequential File Organization
Pile File Method
Sorted File Method
Pile File Method
This method is quite simple, in which we store the records in a sequence i.e one after other in the order in which they are inserted into the tables.
Sorted File Method
As the name itself suggest whenever a new record has to be inserted, it is always inserted in a sorted (ascending or descending) manner.
Sorting of records may be based on any primary key or any other key.
Pros of Sequential File Organization
Fast and efficient method for huge amount of data.
Simple design.
Files can be easily stored in magnetic tapes i.e cheaper storage mechanism.
Cons of Sequential File Organization
Time wastage as we cannot jump on a particular record that is required, but we have to move in a sequential manner which takes our time.
Sorted file method is inefficient as it takes time and space for sorting records.
Heap File Organization
Heap File Organization works with data blocks
Fetching and retrieving records is faster than sequential record but only in case of small databases.
When there is a huge number of data needs to be loaded into the database at a time, then this method of file Organization is best suited.
Problem of unused memory blocks.
Inefficient for larger databases.
Hashing
an efficient technique to directly search the location of desired data on the disk without using index structure.
Data is stored at the data blocks whose address is generated by using hash function.
The memory location where these records are stored is called as data block or data bucket.
B+ Tree File Organization
It uses a tree like structure to store records in File. It uses the concept of Key indexing where the primary key is used to sort the records