DEV Community

Dilsha vijay
Dilsha vijay

Posted on

Organization of records in files

Hello everyone
This is my first ever post in dev community. I am dilsha by the way. I am just learning through this community and sharing whatever I learn to contribute the things I learn. Lets start.

Types of organization of records in a file

  • Sequential file organization
  • Heap file organization
  • Hash file organization
  • Clustered file organization

So the first one in our list is Sequential organization , as the name suggests this is nothing but searching throughout the file using a key which is not necessarily a primary key. Insertion is also pretty simple as we find the record after which we have to add the new record by using this search key.

And if there is a free record that is a empty record before the place we are gonna insert, then the new record takes the place of the empty record.

Then comes Heap file organization. Here the records are placed on the order of inserting them So the insertion in this case is pretty simple just copy the last inserted record into a buffer then the new record is inserted then again the block is rewritten.

However the deletion became complicated deleting the large chunk of records resulted in a waste of storage space. So a much efficient way was to insert a new column named deletion marker with a boolean value maybe. For example if the value is 0 then it is deleted and the search algorithms don't take them while searching and inserting.

Thanks for reading . The next two types will be discussed in the next post.

Top comments (0)