Presentation is loading. Please wait.

Presentation is loading. Please wait.

A New Basis for the SQL Isolation Level Standard Atul Adya: Microsoft Research Barbara Liskov: LCS, MIT Patrick O’ Neil: Univ. Of Mass., Boston.

Similar presentations


Presentation on theme: "A New Basis for the SQL Isolation Level Standard Atul Adya: Microsoft Research Barbara Liskov: LCS, MIT Patrick O’ Neil: Univ. Of Mass., Boston."— Presentation transcript:

1 A New Basis for the SQL Isolation Level Standard Atul Adya: Microsoft Research Barbara Liskov: LCS, MIT Patrick O’ Neil: Univ. Of Mass., Boston

2 2 ANSI Degrees of Isolation Trade-off consistency for performance Serializability  Disallow all “bad” situations Implementation-independent

3 3 ANSI Definitions: Ambiguous “ Flexible” Interpretation: allows bad histories “ Locking” Interpretation: suggested approach –“Disguised” versions of locking –Multi-object constraints not observed as violated [BBG+ 95]: Berenson, Bernstein, Gray, Melton, O’Neil, O’Neil: SIGMOD 95 x 1  10 x 1 : 10y 0 : 50 y 1  90 T1T1 T2T2 x 0 = 50 y 0 = 50

4 4 Need Locking-Independent Defns Current Interpretation Overly restrictive: no concurrent conflicting opns Disallows optimistic and multi-version mechanisms Non-locking implementations: –Desirable in certain environments, e.g., mobile systems –Used in commercial products: [Oracle], [Gemstone] Predicate-based operations: not handled properly

5 5 Our Approach Specifications for ANSI levels ( PL-1, PL-2, PL-3 ) –Implementation-independent and unambiguous –Compatible with existing ANSI definitions –Flexible guarantees for predicate-based operations Definitions for existing commercial levels, e.g., Cursor Stability, Snapshot Isolation [BBG+95, Oracle] Definitions for new levels weaker than serializability E.g., Weakest level that ensures consistent reads

6 6 First Observation Problem: Isolation provided as transactions run Idea: Provide separate guarantees for committed and running transactions Degrees for running transactions Degrees for committed transactions – || | Locking Interpretation 1 3 2 123 – –

7 7 Second Observation Problem: Multi-object constraints captured using conditions on single object histories Idea: Capture using invariants on complete read and write sets of transactions Use serialization graphs

8 8 Direct Serialization Graph x 1  10 x 2 : 20 y 0 : 50 y 1  90 T1T1 T3T3 x 0 = 50 y 0 = 50 x 2  20 T2T2 T1T1 T2T2 T3T3 WWWWWRWR RWRW DSG(H) History H Committed transactions only

9 9 New Definitions: PL-3 and PL-2 Serializability (PL-3): Capture essence of “no dirty reads”, i.e., ensure each committed transaction has only read modifications of committed transactions –No Aborted Reads –No Intermediate Reads –No Circular Information Flow: Disallow cycles consisting of only W  W or W  R edges Disallow all cycles PL-2

10 10 Applying Definitions at PL-3 Bad history disallowed (unlike “flexible”) Good history allowed (unlike “locking” ) WRWRRWRW x 1  10 x 1 : 10y 0 : 50 y 1  90 x 1  10 x 1 : 10y 1 : 90 y 1  90 WRWR T1T1 T2T2 T1T1 T2T2 T1T1 T1T1 T2T2 T2T2 x 0 = 50 y 0 = 50

11 11 Handling Predicates Approach: Add conflict edges for predicate opns T 1 : SELECT * FROM Emp WHERE Dept = Sales T 2 : UPDATE Dept = Legal FROM Emp WHERE Dept = Mktg T 1 and T 2 do not conflict T 3 : DELETE FROM Emp WHERE Location = Boston T 3 changes the set of tuples matched by T 1 ’s read, i.e., T 3 overwrites T 1 ’s predicate-based read T1T1 T3 R W

12 12 Summary Our specifications can form the basis for fixing the ANSI standard –Implementation-independent –Handle predicates correctly –Backwards compatible and intuitive Specifications for existing commercial levels, e.g., Cursor Stability, Snapshot Isolation New useful isolation levels between degrees 2 and 3 http://www.pmg.lcs.mit.edu/~adya http://research.microsoft.com/~adya


Download ppt "A New Basis for the SQL Isolation Level Standard Atul Adya: Microsoft Research Barbara Liskov: LCS, MIT Patrick O’ Neil: Univ. Of Mass., Boston."

Similar presentations


Ads by Google