13.07.2015 Views

13.1 through 13.5, 13.10 and 13.11

13.1 through 13.5, 13.10 and 13.11

13.1 through 13.5, 13.10 and 13.11

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 13 Disk Storage, Basic File Structures, <strong>and</strong> HashingThree primary file organizations were then c-liscussed: unordered, ordered, <strong>and</strong>hashed. Unordered t'iles require a linear search to locate records, but record insertion_is very simple. We discussed the deletion problem <strong>and</strong> the use of deletionmarKers.Ordered files shorten the tirne required to read records in order of the ordering field.The time required to search fbr an arbitrary record, given the value oI its orderingkey field, is also reduced if a binary search is used. However, mair-rtaining the recordsin order makes ir.rsertion very expensive; tl-rus the technique of using an unorderedoverflow file to reduce the cost of record insertion was discussed. Overflow recordsare merged with the rnaster file periodically during file reorganization.Hashing provides very fast access to an arbitrar,v record of a file, given the value ofits hash key. The most suitable method for external hashing is the bucket technique,with one or more contigr-rous blocks corresponding to each bucket. Coilisions causingbucket overflow are h<strong>and</strong>led by chaining. Access on auy nonhash field is slorv,<strong>and</strong> so is ordered access of the records on any field. We discussecl trvo hashing techniquesfor tiles that grorv <strong>and</strong> shrink in the number of records dvr-ramically:extendible <strong>and</strong> linear hashing.We briefly discussed other possibilities for prirnary file organizations, such as B-trees, <strong>and</strong> files of mixed records, which implement relationships among records ofdifferent types physicaily as part of the storage structure. Finally, we reviewed therecent advances in disk technology represented by RAID (Redundant Arr:rys ofInexpensive Ilndependent] Disks).Review Ouestionsi lL ;. What is the difference between primary arrd secondary storage?i l"tWhy are disks, not tapes, used to store online database files?:;:,::. Define the following terms: disk, disk pock, track, block, cylinder, sector,interblock gap, read/write head.::l.I. Discuss the process of disk initialization.1:;.i:i. Discuss the mechanism used to read data from or write data to the disk.1;,{i. What are the components of a disk block address?'!:t-1;. Why is accessing a disk block expensive? Discuss the time conlponentsinvolved in accessing a disk block.' t: ;:1. How does double buffering improve block erccess time?What are the reasons tbr having variable-length records? What types of separatorcharircters are needed for eacl-r?r ,:r" ir Discuss the techniques for allocating file blocks on disk.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!