Figure 5.1 (a) A single-sided disk with read/write hardware. (b) A disk pack with read/write hardware. track (a) arm actuator read/write head spindle disk rotation (b) cylinder of tracks (imaginary) actuator movement
Figure 5.2 Different sector organizations on disk. (a) Sectors subtending a fixed angle. (b) Sectors maintaining a uniform recording density. (a) track sector (arc of a track) (b) three sectors two sectors one sector
Figure 5.3 Data striping. File A is striped across four disks. disk 0 disk 1 disk 2 disk 3 FILE A A 1 A 2 A 3 A 4
Non-Redundant (RAID Level 0) Mirrored (RAID Level 1) Memory-Style ECC (RAID Level 2) Bit-Interleaved Parity (RAID Level 3) Block-Interleaved Parity (RAID Level 4) Block-Interleaved Distribution-Parity (RIAD Level 5) P+Q Redundancy (RAID Level 6) Figure 5.4 Multiple levels of raid. From Chen, Lee, Gibson, Katz, and Patterson (1994), ACM Computing Survey, Vol. 26, No. 2 (June 1994). Reprinted with permisson.
Figure 5.5 Interleaved concurrency versus parallel execution. Interleaved concurrency of operations A and B. Parallel execution of operations C and D. A A B B t 1 t 2 t 3 t 4 Time
Figure 5.6 Use of two buffers, A and B, for reading from disk. disk block: I/O: i fill A i + 1 fill B i + 2 fill A i + 3 fill B i + 4 fill A disk block: PROCESSING: i process A i + 1 process B i + 2 process A i + 3 process B i + 4 process A Time
Figure 5.7 Three record storage formats. (a) A fixed-length record with six fields and size of 71 bytes. (b) A record with two variable-length fields and three fixed-length fields. (c) A variable-field record with three types of separator characters. (a) JOBCODE NAME SSN SALARY DEPARTMENT HIRE-DATE 1 31 40 44 48 68 (b) SALARY JOBCODE NAME SSN 1 12 21 25 29 DEPARTMENT Smith, John 123456789 xxxx xxxx Computer separator characters (c) Separator Characters = separates field name from field value NAME=Smith, John SSN=123456789 DEPARTMENT=Computer separates fields terminates record
Figure 5.8 Types of record organization. (a) Unspanned. (b) Spanned. (a) block i record 1 record 2 record 3 @@@@@@@@@ ;;;;;;;;; QQQQQQQQQ @@@@@@@@@ ;;;;;;;;; QQQQQQQQQ block i + 1 record 4 record 5 record 6 @@@@ ;;;; QQQQ @@@@ ;;;; QQQQ (b) block i record 1 record 2 record 3 record 4 P block i + 1 record 4 (rest) record 5 record 6 record 7 P
NAME SSN BIRTHDATE JOB SALARY SEX block 1 Aaron, Ed Abbott, Diane Acosta, Marc block 2 Adams, John Adams, Robin Akers, Jan block 3 Alexander, Ed Alfred, Bob Allen, Sam block 4 Allen, Troy Anders, Keith Anderson, Rob block 5 Anderson, Zach Angeli, Joe Archer, Sue block 6 Arnold, Mack Arnold, Steven Atkins, Timothy block n 1 Wong, James Wood, Donald Woods, Manny block n Wright, Pam Wyatt, Charles Zimmer, Byron Figure 5.9 Some blocks of an ordered (sequential) file of EMPLOYEE records with NAME as the ordering key field.
Figure 5.10 Internal hashing data structures. (a) Array of M positions for use in internal hashing. (b) Collision resolution by chaining records. (a) NAME SSN JOB SALARY 0 1 2 3 M 2 M 1 (b) 0 1 2 3 4 data fields overflow pointer 1 M 1 1 M + 2 address space M 2 M 1 M M + 1 M + 2 M + O 2 M + O 1 M + 1 1 M + 5 1 M + 4 overflow space null pointer = 1. overflow pointer refers to position of next record in linked list.
Figure 5.11 Matching bucket numbers to disk block addresses. bucket number 0 1 2 block address on disk M 2 M 1
Figure 5.12 Handling overflow for buckets by chaining. main buckets bucket 0 340 460 bucket 1 321 761 91 null 981 182 overflow buckets null bucket 2 22 72 652 null 522 (pointers are to records within the overflow blocks) bucket 9 399 89 null
Figure 5.13 Structure of the extendible hashing scheme. local depth of each bucket DATA FILE BUCKETS d ' = 3 bucket for records whose hash values start with 000 d ' = 3 bucket for records whose hash values start with 001 DIRECTORY 000 001 010 011 100 101 110 111 global depth d = 3 d ' = 2 d ' = 2 d ' = 3 bucket for records whose hash values start with 01 bucket for records whose hash values start with 10 bucket for records whose hash values start with 110 d ' = 3 bucket for records whose hash values start with 111