Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A file has r = 20000 STUDENT records of xed-length. Each record has the followin

ID: 3702564 • Letter: A

Question

A file has r = 20000 STUDENT records of xed-length. Each record has the following fields: NAME (30 bytes), SSN (9 bytes), ADDRESS (40 bytes), PHONE (9 bytes), BIRTHDATE (8 bytes), SEX (1 byte), MAJOR DEPT CODE (4 bytes), MINOR DEPT CODE (4 bytes), CLASS CODE (4 bytes, integer), and DEGREE PROGRAM (3 bytes). An additional byte is used as a deletion marker. The file is stored on the disk whose parameters are: block size B = 512 bytes, interblock gap is G = 128 bytes, the number of blocks per track is 20, and the number of tracks per surface is 400. A disk pack consists of 15 double-sided disks. Assume an unspanned organization.

a. The record size R in bytes is R = bytes.

b. The blocking factor is bfr = records per block.

c. The number of le blocks needed for storage of le is b = blocks.

d. Assume that the le is unordered (with no indexing) and blocks are not stored contiguously.

       1) Then the average time it takes to nd a record is msec.

e. Assume that the le is unordered (with no indexing) and blocks are stored contiguously and double buering is used.

         1) Then the average time it takes to nd a record is msec.

f. Assume the le is ordered by SSN (with no indexing) and le blocks are not stored contiguously.

       1) The average time it takes to search for a record given phone number is msec.

        2) The average time it takes to search for a record given the SSN value is msec.

Explanation / Answer

a) R = (30 + 9 + 40 + 9 + 8 + 1 + 4 + 4 + 4 + 3) + 1 = 113 bytes

b) bfr = floor(B / R) = floor(512 / 113) = 4 records per block

c) b = ceiling(r / bfr) = ceiling(20000 / 4) = 5000 blocks

d) If the blocks are not stored contiguously, a seek is needed for each block,

seek time =30 msec, average rotational delay rd = (time for one disk revolution in msec) / 2 = 25 / 2 = 12.5 msec

Transfer rate tr= (total track size in bytes)/(time for one disk revolution in msec)

tr= (12800) / ( (60 * 1000) / (2400) ) = (12800) / (25) = 512 bytes/msec

block transfer time btt = B / tr = 512 / 512 = 1 msec

so the time is:

2500 (s + rd + btt) = 2500 * (30 + 12.5 + 1) = 108750 msec = 108.75 sec

e) If the blocks are stored contiguously, and double buffering is used, average time to read 2500 consecutive blocks

= s + rd + (2500 * (B/btr))

= 30+12.5+(2500*(512/409.6)) = 3167.5 msec = 3.1675 sec

(or we can estimate less accurately = s + rd + (2500 btt)= 30+12.5+2500*1= 2542.5 msec)

f) Average time to search for a record is given by:

ceiling(log 2 b) * (s +rd + btt)

= ceiling(log 2 5000) * (30 + 12.5 + 1) = 13 * 43.5 = 565.5 msec = 0.5655 sec

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote