Presentation is loading. Please wait.

Presentation is loading. Please wait.

Page 13 1.a) A block is a group of records. A block is referred to as the UNIT of TRANSFER In computer files as when a record is searched / updated the.

Similar presentations


Presentation on theme: "Page 13 1.a) A block is a group of records. A block is referred to as the UNIT of TRANSFER In computer files as when a record is searched / updated the."— Presentation transcript:

1 Page 13 1.a) A block is a group of records. A block is referred to as the UNIT of TRANSFER In computer files as when a record is searched / updated the whole block containing the record is transferred to main store (not just the record) b) Blocks are used to save time. They save time in 2 ways It is quicker to search in main store, therefore the more data that can be placed in main store (rather than disk) the quicker it is to search The Indexes can be smaller thus making them quicker to search Block size is limited by the amount of main store available

2 Page 13 2.a) The payroll file is an Indexed sequential file, this means it can be accessed in 2 ways i)sequentially – when all records need updating - In the monthly pay run the transactions (time Information) would be merged with the main file sequentially to create a new (updated) main file and printouts of payslips ii) Using the index – when few records need updating – If something someone's record changes e.g. address For a monthly payroll run option 1 would be best because all records are processed

3 Page 13 2.b) The record needs to be inserted into the correct place because the file is organised sequentially The key of the record is compared to the primary index. This locates a secondary index The key of the record is compared to the secondary index. This locates a tertiary index The tertiary index locates the block where the record needs to be added This block is loaded into main memory. The record is inserted and the indexes are updated to show that the record is now there. (if there is not sufficient room for all of the record in this block then some of the data is placed in an overflow area on disk and a pointer is inserted to show this) The block is written back to the appropriate location on disk

4 Page 13 2.c) The key of the record is compared to the primary index. This locates a secondary index The key of the record is compared to the secondary index. This locates a tertiary index The tertiary index locates the block where the record needs to be added is found The block containing the record is read to main store. The block is quickly searched in main store and the record found

5 Page 13 3.a) A hierarchy of indexes is when a very large index is split into different levels A Primary index is used to load a secondary index which locates and loads a third index. The third index points to the address in the file of the block containing the record

6 Example of a Hierarchy Index Structure IndexHigh Key 11000 22000 33000 44000 55000 AddressKey 52123101 52123102 52123103 52123104 52133105 52133106 IndexHigh Key 723100 733200 743300 753400 763500 773600 4 Searching for 3105 73

7 Page 13 4. Over time a large file will become ‘untidy’ and inefficient. This can be due to gaps left by deleted records or overflow from inserted records A Housekeeping routine is used to rewrite the file and reorganise the indexes, getting rid of gaps left by deleted records and removing overflow by reorganising the blocks.

8


Download ppt "Page 13 1.a) A block is a group of records. A block is referred to as the UNIT of TRANSFER In computer files as when a record is searched / updated the."

Similar presentations


Ads by Google