Sunday, September 6, 2015

File organization in database

What is file organization / Different file organization techniques / Heap file organization / Sequential file organization / Hash file organization

File organization

Tables in databases stored as files in the disk. Though the tables are treated as files, it actually consists of set of records. The issue is about how we organize the records in a file so as to handle them in the future easily.

File organization –      physical arrangement of data in a file into records and pages;
                                    arrangement of records in a file when the file is stored in a disk;

There are different ways to organize records in a file. They are;

Heap file organization (unordered files): (Click to navigate)


  • Records are stored in random order (no particular order on any attribute values).
  • Records can be stored wherever the space available in a file, that is, a record can be appended at the end of the file or can be inserted in the middle is space available.
  • Simplest file organization.

Sequential file organization (ordered files / sorted files): (Click to navigate)


  • Records are ordered and stored according to the value of an attribute(s) in a file.
  • Records are arranged such that the values of the ordering field are in ascending order.
  • It is slightly complex file organization as we need to arrange the data in  sorted order for every insert and update operation.

Hash file organization (hashed files)  (Click to navigate)


  • Records are stored in a file according to a hash function.
  • A hash function, say h(value), accepts the value of the attribute(s) and assigns the records to several blocks.
  • Very useful file organization if you need a quick access.








No comments:

Post a Comment