Presented by Dr. Greg Speegle
Concurrency Control Multiple Versions Version number timestamp of writing transaction Read last committed value Ex. w0(x)c0R1(x)W1(x)R2(x) First committer wins Ex. w0(x)c0R1(x)W1(x)R2(x)W2(x)c2c1 => abort T1 rw conflicts Ti reads x concurrent with Tj writes x Popular in commercial databases
Lower overhead No read locks No blocking between reads and writes Ex: R1(x)R2(x)W1(x) Non-serializable schedules allowed R1(x)R1(y)R2(x)R2(y)W1(x)W2(y)c1c2 R1(y) T1->T2 R2(x) T2->T1 Write skew
Performance better than 2PL Correctness better than SI
SI plus Booleans InConflict and OutConflict for every transaction SIRead locks Does not block writes Does not block on writes Indicate rw-conflicts
Request SIRead Lock Write lock held by T2 => T1.InConflict = true & T2.OutConflict = true For all versions (Ti) later than version read by T1 T1.InConflict = True Ti.OutConflict = True Continue as in SI
Request Write Lock (in SI) SIREAD lock by T2 T1.OutConflict = true T2.InConflict = true Create new version with timestamp T1 Continue as in SI
T1.InConflict && T1.OutConflict => abort Otherwise, same as SI
R1(x)R1(y)R2(x)R2(y)W1(x)W2(y) W1(x) sets T2.InConflict & T1.OutConflict W2(y) sets T2.OutConflict & T1.InConflict Commit request causes abort
R1(x)R1(y)R2(x)R2(y)W1(x)c1W2(y) SIREAD by T1 released at c1 problem T2.OutConflict not set Maintain locks past commit Release when all concurrent transaction terminated
Assume Not: Cyclic SG and follow protocol All ww/wr conflicts => commit cycle One rw conflict WLOG Tn -> T0 is rw T0 commits before Tn-1 commits, before Tn starts => rw not possible Two consecutive rw conflict InConflict && OutConflict
Two non-consecutive rw conflicts (to appear paper) WLOG, Tn->T0 & Ti->Tj T0 & Tn concurrent, Ti & Tj concurrent Path from T0 to Ti and Tj to Tn non-rw conflicts T0 commits before Ti starts Tj commits before Tn starts Ti and Tj concurrent => T0 committed and Tn not started (not concurrent)
Conservative scheduler R1(x) W2(x)R3(y)W1(y)c1 Equivalent to T3 T1 T2 W2(x) sets T1.InConflict W1(y) sets T1.OutConflict Abort T1 at c1
Positive Theoretical Results Excellent Performance under High Contention Some problems under Low Contention Due to False Positives Future Work - study increased detail to reduce false positives