CS403 GDB SOLUTION SPRING 2021

CS403 GDB SOLUTION SPRING 2021
GDB Question Suppose we have a 999 records of employees Emp1, Emp2, Emp5, Emp6 and so on up to Emp998 and Emp999 stored in a sequence. Hence, records are nothing but a row in the table. In the employee table, we want to inserts new records Emp3 and Emp4 in the sequence, and once we have done insertion we need to update and retrieve the record efficiently to optimize the performance of a database by minimizing the access time when query is being executed.
You are required to solve the problem with the index sequential access method with pros and cons in the given scenario.
Solution ISAM method is an advanced sequential file organization.in this method, records are stored in the file using the primary key. An index value is generated for each primary key and mapped with the record. This index contain the address of the record in the file. Now according to the situation if there is space on track then push the record Emp5 and Emp6 to the next and insert record after Emp2 if there is no space in track all tracks are full then place these records in overflow area in track and link it with track.

Pros:

 In this method, each record has the address of its data block, searching a record in a huge database is quick and easy.

 This method supports range retrieval and partial retrieval of records. Since the index is based on the primary key values, we can retrieve the data for the given range of value. In the same way, the partial value can also be easily searched, i.e., employee name starting with “So” can be easily searched.

Cons:

 This method requires extra space in the disk to store the index value.

 When the new records are inserted, then these files have to be reconstructed to maintain the sequence.

 When the record is deleted, then the space used by it needs to be released Otherwise, the performance will slow down.

Leave a Comment

Your email address will not be published. Required fields are marked *