数据库系统概念(database system concepts)英文第六版 课后练习题 答案 第10章
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2Chapter10Storage and File Structure
has been no partial-write,but they differ in content,then we replace
the contents of thefirst block with the contents of the second,or vice
versa.This recovery procedure ensures that a write to stable storage
either succeeds completely(that is,updates both copies)or results
in no change.
The requirement of comparing every corresponding pair of blocks
during recovery is expensive to meet.We can reduce the cost greatly
by keeping track of block writes that are in progress,using a small
amount of nonvolatile RAM.On recovery,only blocks for which
writes were in progress need to be compared.
b.The idea is similar here.For any block write,the information block is
writtenfirst followed by the corresponding parity block.At the time
of recovery,each set consisting of the n th block of each of the disks
is considered.If none of the blocks in the set have been partially-
written,and the parity block contents are consistent with the con-
tents of the information blocks,then no further action need be taken.
If any block has been partially-written,it’s contents are reconstructed
using the other blocks.If no block has been partially-written,but the
parity block contents do not agree with the information block con-
tents,the parity block’s contents are reconstructed.
10.4Answer:
a.Although moving record6to the space for5,and moving record7
to the space for6,is the most straightforward approach,it requires
moving the most records,and involves the most accesses.
b.Moving record7to the space for5moves fewer records,but destroys
any ordering in thefile.
c.Marking the space for5as deleted preserves ordering and moves
no records,but requires additional overhead to keep track of all
of the free space in thefile.This method may lead to too many
“holes”in thefile,which if not compacted from time to time,will
affect performance because of reduced availability of contiguous
free records.
10.5Answer:(We use“↑i”to denote a pointer to record“i”.)
The originalfile of Figure10.7.
Exercises3
↑1
record0Srinivasan65000
record1↑4
record2Mozart40000
record3Einstein95000
record4↑6
record5Gold87000
record6
record7Califieri62000
record8Singh80000
record9Crick72000
record10Brandt92000
record11Kim80000
a.Thefile after insert(24556,Turnamian,Finance,98000).
↑4
record0Srinivasan65000
record1Turnamian98000
record2Mozart40000
record3Einstein95000
record4↑6
record5Gold87000
record6
record7Califieri62000
record8Singh80000
record9Crick72000
record10Brandt92000
record11Kim80000
b.Thefile after delete record2.