






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







-^ Two-phase locking, holding write locks until after a^ transaction commits. This implies^ –^ recoverability^ –^ no cascading aborts^ –^ strictness (never overwrite uncommitted data) •^ Page-level everything (for now)^ –^ page-granularity locks^ –^ database is a set of pages^ –^ a transaction’s read or write operation operates on an entirepage^ –^ we’ll look at record granularity later
Storage Model • Stable database - survives system failures • Cache (volatile) - contains copies of some pages,which are lost by a system failure Stable DatabaseLog
Read, Write Fetch, FlushPin, Unpin, DeallocateCache Manager
Cache Read, Write
The Cache • Cache is divided into page-sized slots. • Dirty bit tells if the page was updated since it was last written to disk. • Pin count tells number of pin ops without unpins Page Dirty Bit Cache Address^
Pin Count P^1
-^ Fetch(P) - read P into a cache slot. Return slot address.•^ Flush(P) - If P’s slot is dirty and unpinned, then write it todisk (i.e. return after the disk acks)
Latches
-^ A latch is a short-term lock that gives its owner^ access to a page. •^ A read latch allows the owner to read thecontent. •^ A write latch allows the owner to modify thecontent. •^ The latch is usually a bit in a control structure,not an entry in the lock manager. It can be setand released much faster than a lock. •^ There’s no deadlock detection for latches.