


全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Solutions for Chapter 3 Solutions for Section 3 2 Solutions for Section 3 3 Solutions for Section 3 4 Solutions for Section 3 5 Solutions for Section 3 2 Exercise 3 2 1 First note that SQL2 dates require 10 bytes and SQL2 times require 8 bytes if there is no decimal point this material is in Section 3 1 3 a The bytes requirsed by each of the fields is 15 2 10 8 35 b Round each of the four field lengths up to a multiple of 4 to get 16 4 12 8 40 c Round up again to a multiple of 8 to get 16 8 16 8 48 Exercise 3 2 3 The elements in the header also require rounding upward in b and c Thus the lengths including header fields and adding the lengths for the bodies as calculated in Exercise 3 2 1 are a 4 4 1 35 44 b 4 4 4 40 52 c 8 8 8 48 72 Exercise 3 2 5 For parts a and b the header takes 40 bytes while for c it takes 80 bytes The calculations are thus a 4096 40 44 92 b 4096 40 52 78 c 4096 80 72 55 Return to Top Database System Implementation Solutions for Section 3 3 Exercise 3 3 1 The Megatron 747 has 8192 cylinders so we require 2 bytes for the cylinder There are 8 surfaces or 8 tracks per cylinder so 1 byte suffices for the track The average number of sectors per track is 256 and we have chosen to use 8 sectors per block which is not a property of the disk itself If we used blocks consisting of a single sector and the track with the greatest number of sectors had more than 256 then we would need 2 bytes for the sector However at 8 sectors block we could have wildly differing numbers of sectors per track and still not get close to 256 blocks track Since 256 integers can be represented in 1 byte we think that 1 byte is sufficient for the block within a track and we think the correct answer is 4 bytes for the block address on a Megatron 747 Exercise 3 3 3 a Assuming 4096 byte blocks we need another 2 bytes for the position within a block or 6 bytes total Exercise 3 3 7 On the first day since the deletion occurs before any insertions there really isn t a deletion and there are two records and two pointers for a total of 204 bytes this number could be slightly higher if you make the assumption that pointers must be aligned at a multiple of 4 or 8 At each subsequent day the deletion leaves a tombstone in the offset table but one of the 100 byte record areas can be reused Thus the space occupied grows by 104 bytes one record area plus two pointers On day 39 the requirement for space will exceed 4096 We shall then require 204 38 104 4156 bytes and be unable to make the second insertion Exercise 3 3 10 Suppose c is the cost of swizzling an individual pointer This question asks for what values of p is the cost of swizzling fraction p of the pointers at cost c greater than swizzling them all at cost c 2 That is pc c 2 or p 1 2 Return to Top Solutions for Section 3 4 Exercise 3 4 1 The fixed length fields require 30 bytes For the variable length fields we need in the header a record length and pointers to all but the first of the three variable length fields or another 12 bytes Thus we need 42 bytes plus whatever space the variable length fields themselves take Exercise 3 4 2 The average name field takes 30 bytes the average address 50 bytes and the average history 500 bytes Thus the average length of a record is 42 30 50 500 622 bytes Exercise 3 4 5 To start when r is much smaller than 1000 we can surely save by utilizing the extra space in blocks for split records However let s see how close to r 1000 we can still save Without splitting records we can only fit one record per block Thus we can save if we can fit two fragments in less than 1000 bytes i e r 2 16 1000 or r 968 To check suppose r 967 Then the first record leaves 33 bytes so we can take a 16 byte fragment header and 17 bytes of the next record and put it in the first block That leaves 950 bytes plus a 16 byte header for the next block leaving 34 bytes Similarly each split record leaves one more empty byte until eventually there are 967 bytes free on a block and we can slip an extra record into an already used block thus saving a very small amount of space Return to Top Solutions for Section 3 5 Exercise 3 5 1 a Method i requires only one disk read if we know the proper block for a record while method ii with its addition of overflow blocks requires more than one read if the desired record is on an overflock block Thus i is better than ii However in the long run i keeps blocks between full and half full so the average space utilization will be 75 Method ii can keep all but the first block in a chain full so for long chains the
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年微电网稳定性控制与分布式能源系统优化调度策略
- 广东省深圳市普通高中2025-2026学年生物高三第一学期期末经典模拟试题
- 企业广告植入合同
- 2025年云南省镇康县第一中学生物高三第一学期期末质量检测试题
- 2025年志愿服务面试模拟及答案详解
- 欣赏《埃普森赛马》教学设计-2025-2026学年初中美术沪书画版五四学制2024七年级上册-沪书画版五四学制2024
- 2025年安全生产安全检查整改风险评估方法设计方法题库含答案
- 物理突变电流课件
- 2025年技术合同登记员面试准备材料及答案
- 毒气防护知识培训总结课件
- 医院绩效考核指标体系设计与实施
- GB/T 3690-2017织物芯输送带全厚度拉伸强度、拉断伸长率和参考力伸长率试验方法
- 影视动画风格研究课件
- 国际结算-苏宗祥主编
- 八年级地理上册【省份轮廓图】汇总考试题
- 变更风险识别、评估记录表参考模板范本
- 五年级语文阅读理解十篇(含答案)
- DB45T2053-2019 重质碳酸钙单位产品能源消耗限额
- 焊研威达埋弧焊机小车A系列说明书
- 有机热载体锅炉安装工程施工方案完整
- 常规保养双人作业流程新模板汇总
评论
0/150
提交评论