414 Section 7
Locking
May 9th, 2024
Announcements
Locking
Locking Overview
Remember - locking is for database internal implementation
Database Lock
Table Lock
Predicate Lock
Tuple Lock
Lock Granularity
SQLite!
Less Concurrency
More Concurrency
Binary Locks
2PL with Binary Locks
Lock growing phase
Lock shrinking phase
2PL vs. Strict 2PL
Invalid reads
Trickled unlock and transaction end
2PL vs. Strict 2PL
2PL:
Strict 2PL:
3-Tiered Locking (Shared/Exclusive locks)
All the locks!
Concurrency Control Method | Benefit |
2PL | Ensures conflict serializability |
Strict 2PL | Ensures recovery |
Conservative 2PL (not studied in 414) | Ensures deadlock-free |
Lock Type | Benefit |
Binary Locks | Simplest lock implementation |
Shared/Exclusive Locks | Greater throughput on reads |
Worksheet