File Organization 2 Flashcards
1
Q
What are the Types of File Organization
A
- Heap Files(Unordered Records)- Depends on insertion order.
Easy to insert but hard to retrieve - Sorted Files(Ordered Records)-
Sorted using an identifier or key value.
Insertion is expensive but retrieval is easy - Hashing Techniques- Organizational structure using hashing. Database uses buckets not blocks. Record must be hashed then appended to the right bucket
2
Q
Describe Unordered Files(Heap Files) Mentioning how records are searched and inserted
A
Also called a heap or a pile file.
* New records are inserted at the end of the file. Record insertion is quite efficient
* To search for a record, a linear search through the file records is
necessary. This requires reading and searching half the file blocks on the average, and is hence quite expensive.
* Reading the records in order of a particular field requires sorting the
file records.
3
Q
Describe Ordered Files(Sequential Files) Mentioning how records are searched and inserted
A
- File records are kept sorted by the values of an ordering field.
- Insertion is expensive: records must be inserted in the correct order.
- A binary search can be used to search for a record on its ordering field value.
This requires reading and searching log2 of the file blocks on the average, an improvement over linear search. - Reading the records in order of the ordering field is quite efficient.