Any record can be placed anywhere in the file where there is a space. There is no ordering for placing the records in the file. Generally single file is used.
Organization of Records in Files
There are three commonly used approaches of organizing records in file -
(1) Heap file organization: Any record can be placed
anywhere in the file where there is a space. There is no ordering
for placing the
records in the file. Generally single file is used.
(2) Sequential file organization: Records are stored in sequential order based on the value of
search key.
(3) Hashing file organization: A hash function is used
to obtain the location of the record in the file. Based on the value returned
by hash function, the record is stored in the file.
The sequential file organization is a simple file organization method in
which the records are stored based on the search key value.
• For example - Consider following set of records
stored according to the RollNo of student. Note that we assume here that the RollNo
is a search key.
Now if we want to insert following record
Then, we will insert it in sorted order of RollNo and adjust the
pointers accordingly.
• However, maintaining physical
sequential order is very difficult as there can be several insertions and
deletions.cos le
• We can maintain the deletion by next pointer chain.
• For insertion following rules can be
applied -
• If there is free space insert record there.
• If no free space, insert the record in an overflow block.
• In either case, pointer chain must be updated.
In a multitable clustering file organization, records of
several different relations are stored in the same file.
For example - Following two tables Student and Course
The multitable clustering organization for above tables is,
This type of file organization is good for join operations
such as Student Course. This file organization results in variable size
records.
The pointer chain can be added to the above records to keep track of
address of next record. It can be as shown in following Fig. 4.3.2.
Database Management System: Unit IV: Implementation Techniques : Tag: : Implementation Techniques - Database Management System - Organization of Records in Files
Database Management System
CS3492 4th Semester CSE Dept | 2021 Regulation | 4th Semester CSE Dept 2021 Regulation