Sequential file organisation, Database Management System

Assignment Help:

Sequential File Organisation

The most necessary way to organise the collection of records in a file is to use sequential Organisation. Records of the file are stored in series by the primary key field values. They are accessible only in the order stored, i.e., in the primary key order. This type of file Organisation works well for tasks which require accessing nearly each record in a file, e.g., payroll. Let us see the benefits and drawbacks of it.

In a sequentially organised file data are written in a row when the file is created and must be accessed in a row when the file is later used for input (Figure ).

                                                  Figure: Structure of sequential file

                                     490_Sequential File Organisation.png

A sequential file keeps the records in the logical series of its primary key values. Sequential files are useless for random access, though, are suitable for sequential access. A sequential file can be kept on devices like magnetic tape that permit sequential access.

On an average, to search a record in a sequential file would need to look into half of the records of the file. though, if a sequential file is stored on a disk (remember disks support direct access of its blocks) with keyword stored independently from the rest of record, then only those disk blocks require to be read that have the desired record or records. This type of storage permits binary search on sequential file blocks, therefore, enhancing the speed of access.

Updating a sequential file usually makes a new file so that the record sequence on primary key is maintained. The update operation first copies the records till the record after which update is needed into the new file and then the updated record is put followed by the remains of records. Therefore method of updating a sequential file automatically makes a backup copy.

Additions in the sequential files are also handled in a same manner to update. Adding a record needs shifting of all records from the point of insertion to the end of file to make space for the new record. On the other hand deletion of a record needs a compression of the file space.

The basic benefit of sequential file is the sequential processing, as next record is simply accessible despite the absence of any data structure. Though, simple queries are time consuming for large files. A one update is expensive as new file must be formed, thus, to decrease the cost per update, all updates requests are sorted in the order of the sequential file. This update file is then used to update the sequential file in a one go. The file having the updates is sometimes referred to as a transaction file.

This process is known as the batch mode of updating. In this mode every record of master sequential file is checked for one or more possible updates by evaluating with the update information of transaction file. The records are saved to new master file in the sequential way. A record that needs multiple update is written only when all the updates have been presented on the record. A record that is to be deleted is not written to new master file. Therefore, a new updated master file will be formed from the transaction file and old master file.

Therefore, update insertion and deletion of records in a sequential file needs a new file creation. Can we decrease creation of this new file? Yes, it can simply be done if the original sequential file is formed with holes which are empty records spaces as shown in the Figure. Therefore, a reorganisation can be restricted to only a block that can be done very simply within the main memory. Therefore, holes increase the performance of sequential file deletion and insertion. This organisation also maintain a concept of overflow area, which can store the spilled over records if a block is complete. This method is also used in index sequential file organisation.


Related Discussions:- Sequential file organisation

Differentiate oo development from structured development., Differentiate OO...

Differentiate OO development from structured development. Structured approach of problem solving is based upon the idea of decomposition of system into subsystem. In this appro

Software engineering, Critically evaluate the bulleted list of information-...

Critically evaluate the bulleted list of information-related items in this case study. How are each contradictory to the notion of being an information-literate knowledge worker?

Define instance and schema, Define instance and schema?  Instance:  C...

Define instance and schema?  Instance:  Collection of  data  kept in the  data  base  at  a  particular  moment  is  known as an Instance of the database.  Schema: The o

Can a stored procedure call itself, Can a stored procedure call itself or r...

Can a stored procedure call itself or recursive stored procedure? How much level SP nesting is possible? Yes. Because Transact-SQL supports recursion, you can write kept proced

List two restrictions that are applied on the modification, List two restri...

List two restrictions that are applied on the modification (updation, insertion or deletion) of base tables through view.  Ans: The two restrictions are: 1. If a view

Explain function group, What is a function group? A function group is ...

What is a function group? A function group is a collection of logically related modules that share global data with every other.  All the modules in the group are contained in

Design a large scale system, Question: (a) Why is it important to know...

Question: (a) Why is it important to know the architecture rather than to start requirement capture when designing a large scale system? (b) Who are the different people in

List any eight applications of dbms, List any eight applications of DBMS. ...

List any eight applications of DBMS. a) Universities b) Airlines c) Banking d) Credit card transactions e) Tele communication f) Sales g)Finance h) Manufac

What is de-normalization, What is De-normalization? De-normalization is...

What is De-normalization? De-normalization is the method of attempting to optimize the performance of a database by adding redundant data. It is sometimes essential because cur

Explain the disadvantages of using dbms, Explain the disadvantages of using...

Explain the disadvantages of using DBMS There could be a few disadvantages of using DBMS. As DBMS requires computers, we have to invest a good amount in acquiring the hardwa

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd