数据库系统实现习题解答(存储管理部分--吴军)

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

13.3.1 Suppose we are scheduling I/O requests for Megatron 747 disk, and the requests in Fig.13.9 are made, with the head initially at track 16,000. At what time is each request serviced fully if: (1) We use the elevator algorithm( it is permissible to start moving in either direction at first); (2) We use first-come-first-served scheduling; Elevator algorithm 1 +(16000-8000)/4000 + 4.3 =7.3 Cylinder of request 8000 First time available 0 7.3 FIFO
c) What is the maximum rotational latency? A: 60(s)/(6000) = 10 milliseconds d) If a block is 65,546 bytes, what is the transfer time of a block? Tips: 64 sectors with 63 gaps ,total 2000 sectors with 2000 gaps a: degrees =( (63/2000)*10% + (64/2000)*90% ) * 360°= 11.5° (11.5/360) *10= 0.32ms
Tip: 16 surfaces = 2^4; 65536 tracks per surface = 2^16 256 sectors per track = 2^8
13.2.4 suppose the megatron 747 disk head is at cylinder 4096 , i.e, 1/16 of the way across the cylinder. Suppose that the next request is for a block on a random cylinder. Calculate the average time to read the block.
A: 12 + (23 + 1 + 2+2 + 10+2+10+2) = 64B
13.6.1 if we represent physical addresses for the megatron 747 disk by allocating a separate byte or bytes to each of the cylinder, track within a cylinder and block within a track, how many bytes do we need? Make a reasonable assumption about the maximum number of blocks on each track; recall that the megatron 747 has variable number of sectors/track.
Database system implementation second storage management
Wu Jun QQ:908633389 jungsagacity@163.com
13.2.1 The Megatron 777 disk has the following characteristics: (1)There are eight surfaces, with 100,000 tracks each; (2)Tracks hold an average of 2000 sectors of 1024 bytes each; (3)10% of each track is used for gaps; (4)The disk rotates at 6,000 rpm; (5)The time it takes the head to move n tracks is 1+0.0003n milliseconds.
A: 24*365/(N*H*F)
13.5.1 suppose a record has the following fields in this order character string of length 23, an integer of 2 bytes, a SQL date, and a SQL time(no decimal point). How many bytes does the record take if:
Fra Baidu bibliotek
b) 0000 0001 A:01
c) 1010 1100 A:11
13.4.6 suppose that a disk has probability F of failing in a given year, and it takes H hours to replace a disk. a) If we use mirrored disk, what is the mean time to data loss, as a function of F and H? tips: conditional probability: p = P(one disk failure ) | P( the other disk failure) mutual independence: p = P( the other disk failure) A: 1 / [ ( H/(24*365) * F * 2] = 24*365/(2*H*F) b) If we use a RAID level 4 or 5 scheme, with N disks, what is the mean time to data loss?
e) What is the average seek time? a: 1+ (100000/3)*0.0003 = 11ms
f) What is the average rotational latency? a: (the maximum rotational latency)/2 = 5ms g) If tracks are located on the outer inch of a 3.5-inch-diameter surface, what is the average density of bits in the sectors of a track? a : (2000 * 1028 * 8) / [ (3.5/2) * π * 90% ] (bits/inch)
1 4096 65536
The average tracks the heads have to move: [(1+2+……+4095)+(1+2+……(65536-4096)]/65536≈28928 Seek time: 1+28928/4000=8.232ms Transfer time = 0.13ms Rotational latency = 4.17ms Average seek time + average rotational latency +average transfer time = 12.532ms
(7.3) + 1+(480008000)/4000 + 4.3 =22.6
(29.9) +1 + (400004000)/4000 + 4.3 =44.2 (22.6) + 1 + (4800040000)/4000 + 4.3 =29.9
48000
1
(7.3) + 1+(480008000)/4000 + 4.3 =22.6
13.4.2 we can have two parity bits associated with a string if we follow the string by one bit that is a parity bit for the odd positions and a second that is the parity bit for the even positions. For each of the string s in exercise 13.4.1, find the two bits that server in this way. a) 0011 0101 A: 11
(1)Fields can start at any byte;
tip: head info + fields A: 12 +( 23 + 2 + 10 + 10) = 41B (2)Fields must start at a byte that is a multiple of 8; (12 +4) + ( 23 +1 + 2 + 6 + 10+6 + 10+6) = 80B (3)Fields must start at a byte that is a multiple of 4;
(22.6 )+ 1 + (480004000)/4000 + 4.3 =38.9 (38.9 )+ 1 + (400004000)/4000 + 4.3 =53.2
4000
10
40000
20
13.3.2 Suppose we use two megatron 747 disk as mirrors of one another. However, instead of allowing reads of any block from either disk, we keep the head of the first disk in the inner half of the cylinder, and the head of the second disk in the outer half of the cylinders. Assuming read requests are on random tracks, and we never have to write: (1)What is the average rate at which this system can read blocks? A: (1+ (65536/2)/3/4000 ) + 4.17 + 0.13 = 8.03 ms (2)How does this rate compare with the average rate for mirrored megatron 747 disks with no restriction? A: [ 1 + 65536/(3*4000) + 4.17 + 0.13] / 2 = 10.76/2 = 5.38ms (3)What disadvantages do you foresee for this system? A large number of requests for the same disk will lead to accumulation of the requests sequence and idleness of the other disk.
Questions: a) What is the capacity of the disk? A: 8*100 000 * 2000 * 1024 bytes
b) What is the maximum seek time? tip :innermost to outermost track A: 1 + 0.0003 * 100000 = 31ms
相关文档
最新文档