Database System Implementation Exercise chapter2

Exercise 2.2.1:

The Megatron 777 disk has the following characteristics:

1. There are ten surfaces, with 10,000 tracks each.

2. Tracks hold an average of 1000 sectors of 512 bytes each.

3. 20% of each track is used for gaps.

4. The disk rotates at 10,000 rpm.

5. The time it takes the head to move n tracks is 1 + O.OOln milliseconds.

Answer the following questions about the Megatron 777.

* a) What is the capacity of the disk?

capacity=surface num*track num*sector num*sector size = 10000 *1000*10*512B≈50GB

b) If all tracks hold the same number of sectors, what is the density of bits in the sectors of a track?

MAX:if the innermost track has a diameter only 1.5 inch

1000*512*8/(1.5π*90%)≈966265bits/inch

MIN:if outermost track has a diameter only 3.5 inch

1000*512*8/(3.5π*90%)≈414114bits/inch

* c) What is the maximum seek time?

the maximum seek time=1+0.001(1000-1)=1.999milliseconds

* d) What is the maximum rotational latency?

the maximum rotational latency=60s/10000=0.006s/r

e) If a block is 16,384 bytes (i.e., 32 sectors), what is the transfer time of a block?

16384bytes/512bytes= 32 sectors

20%*360degree/1000=0.072degree

80%*360degred/1000=0.288degree

31gap+32sectors=31*0.072+32*0.288=31.532degree

transfer time of a block=6ms/360*31.532≈0.526ms

! f) What is the average seek time?

average seek time:1+0.001*(1000/3)=1.333 ms

g) What is the average rotational latency?

average rotational latency:1/2*6ms=3ms


! Exercise 2.2.2:

Example 2.1: The Megatron 747 disk has the following characteristics, which are typical of a medium-size, vintage-1999 disk drive.

• There are four platters providing eight surfaces.

• There are 8192 tracks per surface.

• There are (on average) 256 sectors per track.

• There are 512 bytes per sector

Suppose the Megatron 747 disk head is at track 1024, i.e., 1/8 of the way across the tracks. Suppose that the next request is for a block on a random track. Calculate the average time to read this block.

answer:

The average tracks the heads have to move:

[(1+2+3+4……+1023)+(1+2+……+8192-1024)]/8192=3200

seek time:3200*0.002+1=7.4ms

rotational time=0.13ms

transfer time=4.17ms

the average time to read the block=7.4ms+0.13ms+4.17ms=11.7ms


*!! Exercise 2.2.3: At the end of Example 2.3 we computed the average distance that the head travels moving from one randomly chosen track to another ran[1]domly chosen track, and found that this distance is 1/3 of the tracks. Suppose, however, that the number of sectors per track were inversely proportional to the length (or radius) of the track, so the bit density is the same for all tracks. Suppose also that we need to move the head from a random sector to another random sector. Since the sectors tend to congregate at the outside of the disk, we might expect that the average head move would be less than 1/3 of the way across the tracks. Assuming, as in the Megatron 747, that tracks occupy radiu from 0.75 inches to 1.75 inches, calculate the average number of tracks the head travels when moving between two random sectors.

这个主要用到积分学进行累加运算后均除.即每个磁道到其他磁道所需穿过磁道数累加/请求次数。

!! Exercise 2.2.4: At the end of Example 2.1 we suggested that the maximum density of tracks could be reduced if we divided the tracks into three regions, with different numbers of sectors in each region. If the divisions between the three regions could be placed at any radius, and the number of sectors in each region could vary, subject only to the constraint that the total number of bytes on the 8192 tracks of one surface be 1 gigabyte, what choice for the five parameters (radius of the two divisions between regions and the numbers of sectors per track in each of the three regions) minimizes the maximum density of any track?

answer:

这个可以估算,即不妨设圆周和扇区数的关系,由于扇区数会影响磁道选择几率,故累加除均值。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值