The cost of locking
Consider the problem of locking two transactions A and B, each a linear sequence of atomic database steps. Let a fixpoint H be a subset of all possible shuffles of the steps of A and B. [Papadimitriou-82] gave a necessary and sufficient condition for H to be realizable as the set of all sequences of steps “legal” under some locking program. This paper addresses two questions his work left unanswered. First, how many locks are required to realize a given fixpoint set? Second, what sets are realizable as fixpoints of a locking program in the case of three or more transactions? Here, in response to the first query, we demonstrate that for two transactions, any fixpoint set which satisfies this condition may be realized with O(m2n) locks, while for three or more transactions, we show the existence of realizable fixpoint sets which require a number of locks exponential in the number of transaction steps. We also give a partial response to the second query, by developing necessary conditions for the realization of fixpoints which involve three transactions.
Unable to display preview. Download preview PDF.
- [Papa-82]C.H. Papadimitriou “A Theorem in Database Concurrency Control”, J. ACM, Vol. 29, No. 4, October 1982, pp. 998–1006.Google Scholar
- [Papa-85]C. H. Papadimitriou “Correction to ‘A Theorem in Database Concurrency Control'”, J. ACM, Vol. 32, No. 3, July 1985, p. 750.Google Scholar
- [YPK-79]Yannakakis, M., Papadimitriou, C.H., and Kung, H.T. “Locking policies: Safety and freedom from deadlock.” Conf. Rec. 20th Ann. IEEE Symp. on Foundations of Computer Science, San Juan, Puerto Rico, 1979, pp. 283–287.Google Scholar