Suppose that a file initially contains r=120,000 records of R=200 bytes each in an unsorted (heap) file. The block size B=2400 bytes, the average seek time s=16 ms, the average rotational latency rd=8.3 ms and the block transfer time btt=0.8 ms. Assume that 1 record is deleted for every 2 records added until the total number of active records is 240,000.

(a) How many block transfers are needed to reorganize the file?

(b) How long does it take to find a record right before reorganization?

(c) How long does it take to find a record right after reorganization?


Let X = # of records deleted
Hence 2X= # of records added.
Total active records
= 240,000 = 120,000 - X + 2X.
Hence, X = 120,000
Records before reorganization (i.e., before deleting any records physically) =
360,000.

(a) No. of blocks for Reorganization
= Blocks Read + Blocks Written.
-200 bytes/record and 2400 bytes/block gives us 12 records per block
-Reading involves 360,000 records; i.e. 360,000/12 = 30K blocks
-Writing involves 240,000 records; i.e., 240000/12 = 20K blocks.
Total blocks transferred during reorganization
= 30K + 20K = 50K blocks.

(b) Time to locate a record before reorganization. On an average we assume that
half the file will be read.
Hence, Time = (b/2)* btt = 15000 * 0.8 ms = 12000 ms.
= 12 sec.

(c) Time to locate a record after reorganization
= (b/2) * btt = 10000 * 0.8 = 8 sec.

Computer Science & Information Technology

You might also like to view...

A menu item may be executed by a user in each of the following ways except __________.

a. by pressing access keys such as Alt + F b. by pressing shortcut keys such as Ctrl + S c. by clicking on the item d. by hovering the mouse over the item

Computer Science & Information Technology

Windows 10 maximizes user involvement during attended installation with an abundance of prompts that user must answer in the middle part of the installation.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Critical Thinking Questions Case Study 7-1 ? Your neighbor is using her computer to buy gifts for her teenage son.  There is only one family computer and she wants to keep the gifts a surprise.  She seeks out your help.? You explain to her how to use:? a.  Reading view b. InPrivate Browsingc.  predictive browsing d. Cortana

What will be an ideal response?

Computer Science & Information Technology

The C++ operator ____ is used to destroy dynamic variables.

A. destroy B. delete C. * D. ˜

Computer Science & Information Technology