Transcript ppt

Operating System
Support for Database
Management
Andrew Gladstone
CSC 8410
3/26/2007
Background
Based on 1981 Stonebraker paper
 Examine OS services as applicable to
database use
 UNIX used as example OS
 INGRES used as example DBMS

OS Services
Buffer Pool Management
 File System
 Scheduling / Process Management
 Consistency

Buffer Management

UNIX provisions:
 Fixed-size
buffer pool
 Size set upon compilation
 I/O handled through main-memory
cache
 LRU replacement strategy for misses
 Block-prefetch for sequential access
Deficiencies
Fetch performance
 Suboptimal replacement strategy

 Access
Types:
Sequential access one time
 Sequential access cyclically re-referenced
 Random access one time
 Random access possible rereference


Inefficient prefetch
Solutions?
DBMS managed buffer pool
 Composite replacement strategy

 Database
access in INGRES:
Sequential access (no re-reference) : toss
immediately
 Sequential access (cyclical re-reference): MRU
 Random access (no re-reference): toss
immediately
 Random access (potential re-reference): LRU


Prefetch?
Crash Recovery
Implemented by the DBMS
 “Intentions List” and “Commit Flag”
 Requires OS to perform “selected force
out”
 Critical to ensure accurate post-crash
writes / rollbacks

File System
Character Arrays
 Designed for sequential access

 DBMS
data generally not sequential
No record management service
 Two OS trees + one DBMS tree

 Why
not one tree?
Scheduling / Process Mgmt.

Two methods proposed
 Process
/ user, shared
code / data

Single process server
 Requires
DBMS
scheduling service
Scheduling Challenges

Separate Processes
 Memory
requirements
 Task switching
 Relies on OS message-passing system

Server Model
 DBMS
must manage scheduling and m/t
 “Mini OS” running in user-space

“Favored-user” class???
Consistency Control
OS lock / protection on file - not record
level
 Update order not guaranteed
 Buffer management / crash-recovery /
locking managed by one system

Summary
OS provided services too slow or
inappropriate
 Most services provided by DBMS
 Double-effort results in considerable
overhead
