This is an archived course. A more recent version may be available at ocw.mit.edu.

Lecture 13: Degrees of Locking

Lectures: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23

Overview

Read:

  • Amazon logo Gray, Jim, et al. "Granularity of Locking and Degrees of Consistency in a Shared Data Base." Modelling in Data Base Management Systems, Proceeding of the IFIP Working Conference on Modelling in Data Base Management Systems. Edited by G. M. Nijssen. Freudenstadt, Germany, January 5-8, 1976. ISBN: 0720404592. Also in Readings in Database Systems. San Fransisco, CA: Morgan Kaufmann, 1998. ISBN: 1558605231.

This paper presents two distinct ideas: first, the notion that there is a "hierarchy of locking" -- e.g., that databases can lock pages, tables, tuples, or fields, and that there is a tradeoff between these various degrees of locking. Second, the paper presents the idea that there are different degrees of consistency which transactions can require, and those different degrees imply different locking disciplines with different performance characteristics.

As you read the papers, consider the following questions:

  1. What is the tradeoff between coarse granularity (e.g., table-level) and fine granularity (e.g., tuple-level) locks in a database system?
  2. How does hierarchical locking help address the phantom problem (hint: see page 374 and the discussion of index-interval locks.)
  3. What are the performance tradeoffs between the different degrees of locking?
  4. How does degree-0 locking ensure compatibility with all other locking modes?