Answer:The typical OS uses variants of LRU, which are cheaper toimplement than LRU, for buffer replacement. LRU and its variants areoften a bad strategy for databases. As explained in Section 10.8.2 of thetext, MRU is the best strategy for nested loop join. In general no singlestrategy handles all scenarios well, and the database system should beable to manage its own buffer cache for which the replacement policytakes into account all the performance related issues.Many operating systems provide mechanisms to lock pages in memory,which can be used to ensure buffer pages stay in memory. However,operating systems today generally do not allow any other control on pagereplacement.10.17List two advantages and two disadvantages of each of the following strate-gies for storing a relational database:a.Store each relation in one file.b.Store multiple relations (perhaps even the entire database) in onefile.Answer:a.Advantages of storing a relation as a file include using the file sys-tem provided by the OS , thus simplifying theDBMS, but incursthe disadvantage of restricting the ability of theDBMSto increaseperformance by using more sophisticated storage structures.Downloaded by Harsh Rawat ([email protected])lOMoARcPSD|16890397
94Chapter 10Storage and File Structureb.By using one file for the entire database, these complex structurescan be implemented through theDBMS, but this increases the sizeand complexity of theDBMS.10.18In the sequential file organization, why is an overflowblockused even ifthere is, at the moment, only one overflow record?Answer:An overflow block is used in sequential file organization be-cause a block is the smallest space which can be read from a disk. There-fore, using any smaller region would not be useful from a performancestandpoint. The space saved by allocating disk storage in record unitswould be overshadowed by the performance cost of allowing blocks tocontain records of multiple files.10.19Give a normalized version of theIndexmetadatarelation, and explain whyusing the normalized version would result in worse performance.Answer:TheIndexmetadatarelation can be normalized as followsIndexmetadata(indexname, relationname, indextype)IndexAttribmetadata (index-name, position, attribute-name)The normalized version will require extra disk accesses to readIndexAttribmetadataeverytime an index has to be accessed. Thus, it will leadto worse performance.10.20If you have data that should not be lost on disk failure, and the data arewrite intensive, how would you store the data?Answer:ARAIDarray can handle the failure of a single drive (two drivesin the case of RAID 6) without data loss, and is relatively inexpensive.There are several RAID alternatives, each with different performance andcost implications. For write intensive data with mostly sequential writes,RAID 1 and RAID 5 will both perform well, but with less storage overheadfor RAID 5. If writes are random, RAID 1 is preferred, since a random blockwrite requires multiple reads and writes in RAID 5.
Upload your study docs or become a
Course Hero member to access this document
Upload your study docs or become a
Course Hero member to access this document
End of preview. Want to read all 213 pages?
Upload your study docs or become a
Course Hero member to access this document