14-2564 DANVAN MANDELA
Read-When data are requested by a Server process which is identified on the disk drive:
the disk head seeks to the appropriate track.
the platter spins until the proper sector of data is under the waiting disk head.
the data is read. The combination of the seek and rotational time associated with obtaining the data is the access time.
the data is then transferred to the embedded disk controller that is physically located on the disk drive unit
Then from the embedded disk controller, the data is sent to the host system (the computer) with one of this type of transport:
Direct Memory Access (DMA): a memory access technology. It allows the system memory (peripherals) to read and write directly into other storage device by bypassing the CPU.
Programmed Input / Output (PIO) refers to control the data access through the CPU. Compared to DMA, PIO transfer rate is slower
Write-During the write operation, the host issue a write command chipset (write command), then this command will be sent to the hard disk.
The Host send an order (write 4 blocks from 1000).
The hard disk after receiving the order ask the host to send the data.
The Data are placed into the write buffer.
The Hard disk find the corresponding blocks in the physical sectors and the data are written to disc.
The Hard disk return information indicating that the write operation is complete.
b). A disk is divided into tracks, cylinders, and sectors. A track is that portion of a disk which passes under a single stationary head during a disk rotation, a ring 1 bit wide. A cylinder is comprised of the set of tracks described by all the heads at a single seek position. Each cylinder is equidistant from the center of the disk. A track is divided into segments of sectors, which is the basic unit of storage.
c). Accessing a disk block is expensive, because of:
Seek time (s): the time needed to mechanically position the read/write head on the correct track for movable-head disks.
Rotational delay: Rotational delay is defined as the waiting time for the desired block to rotate under the disk head; it is the time required for half a rotation on average and is usually less than seek time.
Transfer Time: Transfer time is defined as the time to actually read or write the data in the block once the head is positioned. that is, the time for the disk to rotate over the block.
File organization refers to the way data is stored in a file. File organization is very important because it determines the methods of access, efficiency, flexibility and storage devices to use. There are four methods of organizing files on a storage media. This include:
While access method is a software routine that is part of the operating system or network control program which performs the storing/retrieving or transmitting/receiving of data. It is also responsible for detecting a bad transfer of data caused by hardware or network malfunction and correcting it if possible.
An unordered file- Records are scattered in the memory and they are inefficiently used. Hence increases the memory size. Proper memory management is needed. Not suitable for large tables.
An Ordered file- Rarely used to implement database systems unless an additional access path called a primary index is used, resulting in an indexed sequential file.
A static hash file with buckets and chaining- Fixed number of buckets M is a problem if the number of records in the file grows or shrinks also Ordered access on the hash key is inefficient. Updates are fairly expensive, especially when the directory doubles. If a Bucket overflown with tuples having the same key value, extendible hashing will be splitting this bucket forever.
Search operation, Delete operation and Insertion operation can be performed in the above file organization most expensive operation is searching because we will traverse the data from the beginning of the file till we get the requested record. Thus, if the database is very huge, searching, record will take a lot of time.
Redundant Array of Independent Disks is a disk subsystem that is used to increase performance or provide fault tolerance or both, its main goals are to increase performance and reliability it was achieved by the following
RAID improves performance by disk striping, which interleaves bytes or groups of bytes across multiple drives, so more than one disk is reading and writing simultaneously.
Mirroring and Parity
Fault tolerance is achieved by mirroring or parity. Mirroring is 100% duplication of the data on two drives. Parity is used to calculate the data in two drives and store the results on a third. After a failed drive is replaced, the RAID controller automatically rebuilds the lost data from the other two. RAID systems may have a spare drive ready and waiting to be the replacement for a drive that fails.
Small and Large
RAID subsystems come in all sizes from desktop units to floor-standing model’s Stand-alone units may include large amounts of cache as well as redundant power supplies. Initially used with servers, desktop PCs are increasingly being retrofitted by adding a RAID controller and extra IDE or SCSI disks. Newer motherboards often have RAID controllers.
a) What is the total capacity of a track, and what is its useful capacity (excluding interlock gaps)?
Total Capacity = (512+128) *20 =12800
= 12.8 Kbytes
Useful capacity of a track =512*20
= 10.24 Kbytes
b) How many cylinders are there? Number of cylinders = number of tracks = 400
What is the total capacity and the useful capacity of a cylinder?
Total cylinder capacity =: (512+128) *20*15*2=384000 = 384 KB
Useful cylinder capacity =: 512*20*15*2=307200 = 307.2 KB
What is the total capacity and the useful capacity of a disk pack?
Total capacity of a disk pack =: (512+128) *20*400*15*2=153600000
Useful capacity of a disk pack =: 512*20*400*15*2=122880000
d) Suppose that the disk drive rotates the disk pack at a speed of 2400 rpm (revolutions per minute); what are the transfer rate (tr) in bytes/msec and the block transfer time (btt) in msec? What is the average rotational delay (rd) in msec? What is the bulk transfer rate?
Transfer rate tr= (12800 bytes)/(60*2400rpm) *1000msec/sec = 88.9bytes/msec
block transfer time btt=B*tr= (512)/88.9= 5.76 msec
average rotational delay rd ==1/2*(1/2400) *60*1000= 12.5 msec
e) Suppose that the average seek time is 30 msec. How much time does it take (on the average) in msec to locate and transfer a single block, given its block address?
average time to locate and transfer a block =
primary Index are Index Created on primary key, Clustering Index are Index Created on Non-Key Column but they are ordered, Secondary Index are Index Created in Non-Key column but they are Not ordered. Secondary Index are dense but both primary and cluster are not
There is one index entry in the index file for each block in the data file Each index entry has the value of the primary key field for the first record in a block and a pointer to that block as its two field values.
There is one entry in the clustering index for each distinct value of the clustering field, and it contains the value and a pointer to the first block in the data file that has a record with that value for its clustering field. Notice that record insertion and deletion still cause problems because the data records are physically ordered. To alleviate the problem of insertion, it is common to reserve a whole for each value of the clustering field all records with that value are placed in the block which makes insertion and deletion relatively straightforward.
The secondary index may be created on a field that is a candidate key and has a unique value in every record, or on a non-key field with duplicate values. The index is again an ordered file with two fields. The first field is of the same data type as some non-ordering field of the data file that is an indexing field, second field is either a block pointer or a record pointer, many secondary indexes can be created for the same file each represents an additional means of accessing that file based on some specific field.
b). A physical index is the actual indexing structure as it is stored on disk. A logical index is a reference to a physical index. When you create a logical index, an entry is made in the ISYSIDX system table to hold the index definition.