Disk Storage Flashcards
Why do we not only use main memory?
DB might not fit on main memory
Main memory is volatile
What is a buffer manager?
Component of the DBMS which determines when to move data from the disk to the main memory. It ensures durability by making sure that data written by committed transactions is written to the disk
Describe random access and sequential access. Which is faster
In random access, data can be read from anywhere on the disk. In sequential access, data in only read from current track+sector
Reading large amounts of small data pieces by random access is slow
What is rotational delay and what is seek time
Seek time is the time taken to locate the right track. Rotational delay is the time it takes for the right sector to be underneath the arm (half the rotation time)
What is a block?
A portion of a track that subtends a fixed angle at the center is known as a sector or a block
What is a track
Concentric circles of small width on a disk surface on which information is stored. They each have a distinct diameter
What is a cylinder and why is it important
Tracks with the same diameter form a cylinder.
It is important because it is much easier to retrieve data if it was stored on the same cylinder than if it was stored across cylinders
Describe the interblock gap?
Blocks are separated by fixed-size interblock gaps whic include specially coded control information used to determine which block follows each gap
What happens when Programs call on the buffer manager when they need a block from
disk
- In block is already in buffer, return address of the block in main memory
- If not:
a) Make space for block
b)Replace a block in the buffer if necessary. If the replaced block was modified since the most
recent time that it was written to/fetched from the disk, write it to the disk
c)Read block from disk to buffer. Return address of block to main memory
What is a buffer and how is it used during read and write commands
Buffer is a contiguous reserved area in main storage that holds either one disk block or a cluster. For a read command a block is copied onto the buffer. For a write command the contents of the buffer are written to the disk block
Give the function of the following file operations: open, find, findnext, read, insert, delete, modify, close, reorganize, read-ordered
OPEN: Readies the file for access, and associates a pointer that will refer to
a current file record at each point in time.
* FIND: Searches for the first file record that satisfies a certain condition, and
makes it the current file record.
* FINDNEXT: Searches for the next file record (from the current record) that
satisfies a certain condition, and makes it the current file record.
* READ: Reads the current file record into a program variable.
* INSERT: Inserts a new record into the file, and makes it the current file
record.
* DELETE: Removes the current file record from the file, usually by
marking the record to indicate that it is no longer valid.
* MODIFY: Changes the values of some fields of the current file record.
* CLOSE: Terminates access to the file.
* REORGANIZE: Reorganizes the file records. For example, the records marked deleted are physically removed from the file or a new organization of the file records is created.
* READ_ORDERED: Read the file blocks in order of a specific field of the file.