Databases Reference
In-Depth Information
Track 2 of cylinder 76
Track 1 of cylinder 76
Track 0 of cylinder 76
FIGURE 8.8
Cylinder 76's tracks
Why is the concept of the cylinder important? Because in storing or retrieving
data on a disk, you can move from one track of a cylinder to another without having
to move the access-armmechanism . The operation of turning off one read/write head
and turning on another is an electrical switch that takes almost no time compared to
the time it takes to move the access-arm mechanism. Thus, the ideal way to store
data on a disk is to fill one cylinder and then move on to the next cylinder, and so on.
This speeds up the applications that use the data considerably. Incidentally, it may
seem that this is important only when reading files sequentially, as opposed to when
performing the more important direct access operations. But we will see later that
in many database situations closely related pieces of data will have to be accessed
together, so that storing them in such a way that they can be retrieved quickly can
be a big advantage.
Steps in Finding and Transferring Data Summarizing the way these disk devices
work, there are four major steps or timing considerations in the transfer of data from
a disk to primary memory:
1. Seek Time: The time it takes to move the access-arm mechanism to the correct
cylinder from its current position.
2. Head Switching: Selecting the read/write head to access the required track of
the cylinder.
3. Rotational Delay: Waiting for the desired data on the track to arrive under the
read/write head as the disk is spinning. On average, this takes half the time of one
full rotation of the disk. That's because, as the disk is spinning, at one extreme
the needed data might have just arrived under the read/write head at the instant
the head was turned on, while at the other extreme you might have just missed
it and have to wait for a full rotation. On the average, this works out to half a
rotation.
4. Transfer Time: The time to move the data from the disk to primary memory
once steps 1-3 have been completed.
One last point. Another term for a record in a file is a logical record. Since
the rate of processing data in the CPU is much faster than the rate at which data
can be brought in from secondary memory, it is often advisable to transfer several
consecutively stored logical records at a time. Once such a physical record or block
of several logical records has been brought into primary memory from the disk,
each logical record can be examined and processed as necessary by the executing
program.
Search WWH ::




Custom Search