24s.pdf

《数据库系统概念第六版》配套课后习题答案

收藏

资源目录
跳过导航链接。
压缩包内文档预览:
预览图 预览图 预览图 预览图
编号:211097282    类型:共享资源    大小:12.43MB    格式:ZIP    上传时间:2022-05-05 上传人:考**** IP属地:山西
30
积分
关 键 词:
数据库系统概念第六版 数据库 系统 概念 第六 配套 课后 习题 答案
资源描述:
《数据库系统概念第六版》配套课后习题答案,数据库系统概念第六版,数据库,系统,概念,第六,配套,课后,习题,答案
内容简介:
CHAPTER24Advanced ApplicationDevelopmentPractice Exercises24.1Many applications need to generate sequence numbers for each trans-action.a.Ifasequencecounterislockedintwo-phasemanner,itcanbecomea concurrency bottleneck. Explain why this may be the case.b.Many database systems support built-in sequence counters thatare not locked in two-phase manner; when a transaction requestsa sequence number, the counter is locked, incremented and un-locked.i.Explain how such counters can improve concurrency.ii.Explain why there may be gaps in the sequence numbers be-longing to the final set of committed transactions.Answer: If two-phase locking is used on the counter, the counter mustremainlockedinexclusivemodeuntilthetransactionisdoneacquiringlocks. During that time, the counter is unavailable and no concurrenttransactions can be startedregardlessof whether they would have dataconflicts with the transaction holding the counter.If locking is done outside the scope of a two-phase locking protocol,the counter is locked only for the brief time it takes to increment thecounter. SInce there is no other operation besides increment performedonthecounter,thiscreatesnoproblemexceptwhenatransactionaborts.During an abort, the counter cannot be restored to its old value butinsteadshouldremainasitstands.Thismeansthatsomecountervaluesareunusedsincethosevalueswereassignedtoabortedtransactions.Tosee why we cannot restore the old counter value, assume transactionTahas counter value 100 and then Tbis given the next value, 101. IfTaaborts and the counter were restored to 100, the value 100 wouldbe given to some other transaction Tcand then 101 would be given to910Chapter 24Advanced Application Developmenta second transaction Td. Now we have two non-aborted transactionswith the same counter value.24.2Suppose you are given a relation r(a,b,c).a.Give an example of a situation under which the performance ofequality selection queries on attribute a can be greatly affected byhow r is clustered.b.Suppose you also had range selection queries on attribute b. Canyou cluster r in such a way that the equality selection queries onr.a and the range selection queries on r.b can both be answeredefficiently? Explain your answer.c.If clustering as above is not possible, suggest how both typesof queries can be executed efficiently by choosing appropriateindices.Answer:a.Ifr isnotclusteredona,tuplesofr withaparticulara-valuecouldbe scattered throughout the area in which r is stored. This wouldmake it necessary to scan all of r. Clustering on a combined withan index, would allow tuples of r with a particular a-value to beretrieved directly.b.This is possible only if there is a special relationship between aand b such as “if tuple t1has an a-value less than the a-value oftuple t2, then t1must have a b-value less than that of t2”. Asidefrom special cases, such a clustering is not possible since the sortorder of the tuples on a is different from the sort order on b.c.The physical order of the tuples cannot always be suited to bothqueries.Ifr isclusteredona andwehavea B+-treeindexonb,thefirstquerycanbeexecutedveryefficiently.Forthesecond,wecanuse the usual B+-tree range-query algorithm to obtain pointers toall the tuples in the result relation, then sort those those pointersso that any particular disk block is accessed only once.24.3Suppose that a database application does not appear to have a sin-gle bottleneck; that is,CPUand disk utilization are both high, and alldatabase queues are roughly balanced. Does that mean the applicationcannot be tuned further? Explain your answer.Answer:it may still be tunable. Example using a materialized viewmay reduce both CPU and disk utilization24.4Suppose a system runs three types of transactions. Transactions of typeA run at the rate of 50 per second, transactions of type B run at 100 persecond, and transactions of type C run at 200 per second. Suppose themix of transactions has 25 percent of type A, 25 percent of type B, and50 percent of type C.Practice Exercises11a.What istheaveragetransactionthroughput ofthesystem,assum-ing there is no interference between the transactions?b.What factors may result in interference between the transactionsof different types, leading to the calculated throughput beingincorrect?Answer:a.Let there be 100 transactions in the system. The given mix oftransaction types would have 25 transactions each of type AandB, and 50 transactions of type C. Thus the time taken to executetransactionsonlyoftype Ais0.5secondsandthatfortransactionsonly of type B or only of type C is 0.25 seconds. Given that thetransactions do not interfere, the total time taken to execute the100 transactions is 0.5 + 0.25 + 0.25 = 1 second. i.e, the averageoverall transaction throughput is 100 transactions per second.b.One of the most important causes of transaction interference islock contention. In the previous example, assume that transac-tions of type A and B are update transactions, and that those oftype C are queries. Due to the speed mismatch between the pro-cessor and the disk, it is possible that a transaction of type A isholding alock on a“hot” itemof dataand waiting for adiskwriteto complete, while another transaction (possibly of type B or C)is waiting for the lock to be released by A. In this scenario someCPU cycles are wasted. Hence, the observed throughput wouldbe lower than the calculated throughput.Conversely, if transactions of type Aand type B are disk bound,and those of type C are CPU bound, and there is no lock con-tention, observedthroughput may evenbe better than calculated.Lock contention can also lead to deadlocks, in which case sometransaction(s) will have to be aborted. Transaction aborts andrestarts (which may also be used by an optimistic concurrencycontrol scheme) contribute to the observed throughput beinglower than the calculated throughput.Factors such as the limits on the sizes of data-structures and thevarianceinthetimetakenbybook-keepingfunctions of thetrans-action manager may also cause a difference in the values of theobserved and calculated throughput.24.5List some benefits and drawbacks of an anticipatory standard com-pared to a reactionary standard.Answer: In the absence of an anticipatory standard it may be difficultto reconcile between the differences among products developed byvarious organizations. Thus it may be hard to formulate a reactiona
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
提示  人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:《数据库系统概念第六版》配套课后习题答案
链接地址:https://www.renrendoc.com/paper/211097282.html

官方联系方式

2:不支持迅雷下载,请使用浏览器下载   
3:不支持QQ浏览器下载,请用其他浏览器   
4:下载后的文档和图纸-无水印   
5:文档经过压缩,下载后原文更清晰   
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

网站客服QQ:2881952447     

copyright@ 2020-2025  renrendoc.com 人人文库版权所有   联系电话:400-852-1180

备案号:蜀ICP备2022000484号-2       经营许可证: 川B2-20220663       公网安备川公网安备: 51019002004831号

本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知人人文库网,我们立即给予删除!