database management System for cse

Advantage of concurrency control
 
waiting time (increase)
Responce time (decrease)
Resource utilization (increase)
Efficiency (increase)


Conflict Serializability

Conflict Serializable: A schedule is called conflict serializable if it can be transformed into a serial schedule by
 swapping non-conflicting operations.
Conflicting operations: Two operations are said to be conflicting if all conditions satisfy:
They belong to different transaction
They operation on same data item 
At Least one of them is a write operation
Example: –
1.Conflicting operations pair (R1(A), W2(A)) because they belong to two different transactions on same data
 item A and one of them is write operation
2.Similarly, (W1(A), W2(A)) and (W1(A), R2(A)) pairs are also conflicting 
3.On the other hand, (R1(A), W2(B)) pair is non-conflicting because they operate on different data item 
Similarly, ((W1(A), W2(B)) pair is non-conflicting
If there will be cycle then no conflict serializable if no cycle then conflict serializable.
 In below example first is not conflict sr and second is conflict serializable.
EXAMPLE 
...............................................................................................................................................

S : R1(B) ,R3(C), R1(A) ,W2(A) ,W1(A), W2(B) ,W3(B), W1(B) ,W3(B) ,W3(C)
CYCLE IS AVAILABLE SO NO CONFLICT SERIALIZABLE
...........................................................................................................................................................
CYCLE IS  NOT AVAILABLE SO CONFLICT SERIALIZABLE
 ....................................................................................................................................................................

 
CYCLE IS AVAILABLE SO NO CONFLICT SERIALIZABLE

................................................................ 


View Serializable
Two schedules S1 and S2 are said to be view equal iff following below conditions are satisfied :
1) Initial Read
If a transaction T1 reading data item A from initial database in S1 then in S2 also T1 should read A from initial database.


  T1     T2     T3
-------------------
        R(A)
 W(A)          
               R(A)
        R(B)
Transaction T2 is reading A form initial database.
2)Updated Read
If Ti is reading A which is updated by Tj in S1 then in S2 also Ti should read A which is updated by Tj.


  T1     T2     T3         T1    T2    T3                   
-------------------       ----------------
  W(A)                    W(A)       
        W(A)                           R(A)
                R(A)             W(A)
Above two schedule are not view equal as in S1 :T3 is reading A updated by T2, in S2 T3 is reading A updated by T1.
3)Final Write operation
If a transaction T1 updated A at last in S1, then in S2 also T1 should perform final write operations.


 T1       T2        T1     T2            
------------    ---------------
 R(A)              R(A)
         W(A)      W(A)
 W(A)                    W(A)
Above two schedule are not view as Final write operation in S1 is done by T1 while in S2 done by T2.
View Serializability: A Schedule is called view serializable if it is view equal to a serial schedule (no overlapping transactions).
INFO View Serializability


Below Schedules are view serializable
It is vs                        


It is vs
Recoverable schedule:
Below table shows a schedule with two transactions, T1 reads and writes A and that value is read and written by T2. T2 commits. But later on, T1 fails. So we have to rollback T1. Since T2 has read the value written by T1, it should also be rollbacked. But we have already committed that. So this schedule is irrecoverable schedule.
No RS
Below Table 2 shows a schedule with two transactions, T1 reads and writes A and that value is read and written by T2. But later on, T1 fails. So we have to rollback T1. Since T2 has read the value written by T1, it should also be rollbacked. As it has not committed, we can rollback T2 as well. So it is recoverable with cascading rollback.
Recoverable with cascading rollback: If Tj is reading value updated by Ti and commit of Tj is delayed till commit of Ti , the schedule is called recoverable with cascading rollback.

Comments

Popular posts from this blog

dynamic programming important question