Chapter7 - StoringData:DisksandFiles Chapter7...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Storing Data: Disks and Files Chapter 7 “Yea, from the table of my memory I’ll wipe away all trivial fond records.” -- Shakespeare,  Hamlet
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Database Management Systems, R. Ramakrishnan and J. Gehrke 2 Disks and Files   DBMS stores information on (“hard”) disks. This has major implications for DBMS design ! READ: transfer data from disk to main memory (RAM). WRITE: transfer data from RAM to disk. Both are high-cost operations, relative to in-memory operations, so must be planned carefully !
Background image of page 2
Database Management Systems, R. Ramakrishnan and J. Gehrke 3 Why Not Store Everything in Main Memory? Costs too much. $100 will buy you either 128MB of RAM or 8GB of disk today. Main memory is volatile. We want data to be saved between runs. (Obviously !) Typical storage hierarchy: Main memory (RAM) for currently used data. Disk for the main database (secondary storage). Tapes for archiving older versions of the data (tertiary storage).
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Database Management Systems, R. Ramakrishnan and J. Gehrke 4 Disks Secondary storage device of choice. Main advantage over tapes: random access vs. sequential . Data is stored and retrieved in units called disk blocks or pages. Unlike RAM, time to retrieve a disk page varies depending upon location on disk. Therefore, relative placement of pages on disk has major impact on DBMS performance!
Background image of page 4
Database Management Systems, R. Ramakrishnan and J. Gehrke 5 Components of a Disk  Platters  The platters spin (say, 90rps). Spindle  The arm assembly is moved  in or out to position  a head on  a desired track. Tracks under  heads  make    a  cylinder   (imaginary!). Disk head Arm movement Arm assembly  Only one head reads/ writes at any one time. Tracks Sector  Block size  is a multiple             of  sector size  (which is fixed).
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Database Management Systems, R. Ramakrishnan and J. Gehrke 6 Accessing a Disk Page Time to access (read/write) a disk block: seek time  ( moving arms to position disk head on track ) rotational delay  ( waiting for block to rotate under head ) transfer time  ( actually moving data to/from disk surface ) Seek time and rotational delay dominate. Seek time varies from about 1 to 20msec Rotational delay varies from 0 to 10msec Transfer rate is about 1msec per 4KB page Key to lower I/O cost:  reduce seek/rotation  delays!   Hardware vs. software solutions ?
Background image of page 6
Database Management Systems, R. Ramakrishnan and J. Gehrke 7 Arranging Pages on Disk ` Next ’  block concept:   – blocks on same track, followed by – blocks on same cylinder, followed by – blocks on adjacent cylinder Blocks in a file should be arranged sequentially on 
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 34

Chapter7 - StoringData:DisksandFiles Chapter7...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online