INFO445: Advanced Database Design, Management, and Maintenance
INFO445: Advanced Database Design, Management, and Maintenance
Admin
Upcoming assignment(s)
Next Monday by noon
Lab Assignment #2
Last Time
How data and indexes are represented in a RDBMS
What is the system catalog?
Need to explore alternative ways to execute query and choose the most efficient approach (query evaluation plan)
How is a QEP determined? What is the benefit of understanding QEPs?
Outline
Interface
SQL Commands
Activity I
Activity II
Break
Storing Data
How is data stored in a computer system and how does it affect DB design? How is physical storage structured and how does it affect DB design? How does a DBMS manage space on disks?
10
???
11
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!
12
13
Structure of Disks
The platters spin (say, 90rps) The arm assembly is moved in or out to position a head on a desired track. Tracks under heads make a cylinder Only one head reads/writes at any one time Disk block or page size is a multiple of sector size (which is fixed)
Access time = seek time + rotational delay + transfer time
Spindle Tracks
Disk head
Sector
Arm movement
Platters
Arm assembly
14
Request for a sequence of pages must be satisfied by allocating the pages sequentially on disk!
Keeps track of free disk space
15
Buffer Manager
Minimize disk accesses
Data must be in RAM for DBMS to operate on it Maintain table of <frame#, pageid> pairs
disk page free frame MAIN MEMORY DISK
DB
16
17
Indexes
Data structure to organize data records on disk (hash, tree)
Optimize retrieval operations Retrieve records satisfying search conditions on search key fields
18
Activity III
19
In Summary
QEPs
Optimization heuristics? How can understanding them help us to write more efficient queries?
Storing data
How data is stored and its implications? What components play a role?
20
21