Presentation is loading. Please wait.

Presentation is loading. Please wait.

Concurrency Control by Validation

Similar presentations


Presentation on theme: "Concurrency Control by Validation"— Presentation transcript:

1 Concurrency Control by Validation
Swathi Vegesna

2 At a Glance Introduction Validation based scheduling
Validation based Scheduler Expected exceptions Validation rules Example Comparisons Summary References

3 Introduction What is optimistic concurrency control?
Timestamp- based scheduling and Validation-based scheduling

4 Validation based scheduling
Scheduler keep a record of what the active transactions are doing. Executes in 3 phases Read Validate Write

5 Validation based Scheduler
Contains an assumed serial order of transactions. Maintains three sets: START( ): set of T’s started but not completed validation. VAL( ): set of T’s validated but not finished the writing phase. FIN( ): set of T’s that have finished.

6 Expected exceptions 1. Suppose there is a transaction U, such that:
U is in VAL or FIN; that is, U has validated, FIN(U)>START(T); that is, U did not finish before T started RS(T) ∩WS(T) ≠φ; let it contain database element X. 2. Suppose there is transaction U, such that: U is in VAL; U has successfully validated. FIN(U)>VAL(T); U did not finish before T entered its validation phase. WS(T) ∩ WS(U) ≠φ; let x be in both write sets.

7 Validation rules Check that RS(T) ∩ WS(U)= φ for any previously validated U that did not finish before T has started ie FIN(U)>START(T). Check that WS(T) ∩ WS(U)= φ for any previously validated U that did not finish before T is validated ie FIN(U)>VAL(T)

8 Example

9 Solution Validation of U: Nothing to check Validation of T:
WS(U) ∩ RS(T)= {D} ∩{A,B}=φ WS(U) ∩ WS(T)= {D}∩ {A,C}=φ Validation of R: RS(V) ∩ WS(T)= {B}∩{A,C}=φ WS(V) ∩ WS(T)={D,E}∩ {A,C}=φ RS(V) ∩ WS(U)={B} ∩{D}=φ Validation of W: RS(W) ∩ WS(T)= {A,D}∩{A,C}={A} WS(W) ∩ WS(V)= {A,D}∩{D,E}={D} WS(W) ∩ WS(V)= {A,C}∩{D,E}=φ (W is not validated)

10 Comparison Concurrency control Mechanisms Storage Utilization Delays
Locks Space in the lock table is proportional to the number of database elements locked. Delays transactions but avoids rollbacks Timestamps Space is needed for read and write times with every database element, neither or not it is currently accessed. Do not delay the transactions but cause them to rollback unless Interface is low Validation Space is used for timestamps and read or write sets for each currently active transaction, plus a few more transactions that finished after some currently active transaction began. Do not delay the transactions but cause them to rollback unless interface is low

11 Summary Concurrency control by validation The three phases
Validation Rules Comparison

12 References Database Systems: The Complete Book

13 Thank you


Download ppt "Concurrency Control by Validation"

Similar presentations


Ads by Google