Storage and File Structure - Department of Computer Science and

Transcription

Storage and File Structure - Department of Computer Science and
CSL 451 Introduction to Database Systems
Storage and File Structure
Department of Computer Science and Engineering
Indian Institute of Technology Ropar
Narayanan (CK) Chatapuram Krishnan!
Summary
•  Physical Storage Media
–  cache - main memory - flash
storage - magnetic disk - optical
storage - tapes
•  Performance measures of disks
–  access time
–  seek time
•  RAID
–  mirroring
•  mean time to repair
•  mean time to data loss
–  striping
•  bit-level striping
•  block-level striping
–  RAID levels
•  average seek time
–  rotational latency time
•  0, 1, 2, 3, 4 and 5
•  average latency
–  data transfer rate
–  mean time to failure
•  Disk-Block access
–  block
•  sequential access
•  random access
–  buffering, read-ahead, scheduling,
file organization.
•  Flash Storage
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
2!
RAID Levels
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
3!
Summary
•  Physical Storage Media
–  cache - main memory - flash
storage - magnetic disk - optical
storage - tapes
•  Performance measures of disks
–  access time
–  seek time
•  RAID
–  mirroring
•  mean time to repair
•  mean time to data loss
–  striping
•  bit-level striping
•  block-level striping
–  RAID levels
•  average seek time
–  rotational latency time
•  average latency
•  0, 1, 2, 3, 4 and 5
•  scrubbing
•  File Organization
–  data transfer rate
–  mean time to failure
–  blocks
–  fixed length records
•  Disk-Block access
•  free list
–  block
–  variable length records
•  sequential access
•  random access
•  slotted page structure
–  buffering, read-ahead, scheduling,
file organization.
•  Flash Storage
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
4!
Slotted Page Structure
Block Header
Size
# Entries
Location
Records
Free Space
End of Free Space
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
5!
Summary
•  Physical Storage Media
–  cache - main memory - flash
storage - magnetic disk - optical
storage - tapes
•  Performance measures of disks
–  access time
–  seek time
–  rotational latency time
•  average latency
•  mean time to repair
•  mean time to data loss
–  striping
•  bit-level striping
•  block-level striping
•  0, 1, 2, 3, 4 and 5
•  scrubbing
•  File Organization
–  data transfer rate
–  mean time to failure
–  blocks
–  fixed length records
•  Disk-Block access
•  free list
–  block
–  variable length records
•  sequential access
•  random access
•  slotted page structure
–  buffering, read-ahead, scheduling,
file organization.
11/04/15!
–  mirroring
–  RAID levels
•  average seek time
•  Flash Storage
•  RAID
–  record organization
•  heap, sequential, hashing
•  Database Buffer
–  buffer manager
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
6!
List the advantages and disadvantages of RAID-3 over RAID-1
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
7!
Comment on the performance of RAID-4
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
8!
10.1 Consider the data and parity-block arrangement on four
disks. The Bi’s represent data blocks; the Pi’s represent parity
blocks. Parity block Pi is the parity block for data blocks B4i-3 to
B4i. What, if any problem might this arrangement present?
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
9!
10.3 A power failure that occurs while a disk block is being
written could result in the block being only partially written.
Assume that partially written blocks can be detected. An atomic
block write is one where either the disk block is fully written or
nothing is written (i.e., there are not partial writes). Suggest
schemes for getting the effect of atomic block writes for RAID
level 1 (mirroring). Your schemes should involve work on
recovery from failure.
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
10!
10.2.a Flash Storage: How is the flash translation table, which is
used to map logical page numbers to physical numbers, created
in memory?
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
11!
10.2.b Flash Storage: Suppose you have a 64GB flash storage
system, with a 4096 byte page size. How big would the flash
translation table be, assuming each page has a 32 bit address,
and the table is stored as an array.
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
12!
10.2.c Flash Storage: Suggest how to reduce the size of the
translation table if very often long ranges of consecutive logical
page numbers are mapped to consecutive physical page
numbers
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
13!
10.11 How does the remapping of bad sectors by disk
controllers affect the data retrieval rates?
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
14!
10.20 If you have data that should not be lost on disk failure,
and the data are write intensive, how would you store the data?
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
15!
10.4 Consider the deletion of record 5 from the following file.
Compare the relative merits of the following techniques for
implementing the deletion –
a.  Move record 6 to the space occupied by record 5, and move
record 7 to the space occupied by record 6.
b.  Move record 7 to the space occupied by record 5.
c.  Mark record 5 as deleted, and move no records.
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
16!
10.5 Show the structure of the file after each of the following
steps
a.  Insert(24556, Turnamian, Finance, 98000)
b.  Delete record 2
c.  Insert(34556, Thompson, Music, 67000)
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
17!
10.7 Consider the following bitmap technique for tracking free
space in a file. For each block in the file, two bits are maintained
in the bitmap. If the block is between 0 and 30 percent full the
bits are 00, between 30 and 60 percent the bits are 01, between
60 and 90 percent the bits are 10, and above 90 percent the bits
are 11. Such bitmaps can be kept in main memory even for
quite large files.
a.  Describe how to keep the bitmap up to date on record
insertions and deletions.
b.  Outline the benefit of the bitmap technique over free lists in
searching for free space and in updating free space
information.
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
18!
10.13 What is scrubbing, in the context of RAID systems, and
why is scrubbing important?
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
19!
10.15 Explain why the allocation of related records to blocks
affects database-system performance significantly?
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
20!
10.9 Give an example of a relational-algebra expression and a
query-processing strategy where MRU is preferable to LRU
11/04/15!
Department of Computer Science and Engineering !
Indian Institute of Technology Ropar!
21!