C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
View Serializability
View EquivalentTwo schedules S1 and S2 are said to be view equivalent if they satisfy the following conditions: 1. Initial ReadAn initial read of both schedules must be the same. Suppose two schedule S1 and S2. In schedule S1, if a transaction T1 is reading the data item A, then in S2, transaction T1 should also read A. Above two schedules are view equivalent because Initial read operation in S1 is done by T1 and in S2 it is also done by T1. 2. Updated ReadIn schedule S1, if Ti is reading A which is updated by Tj then in S2 also, Ti should read A which is updated by Tj. Above two schedules are not view equal because, in S1, T3 is reading A updated by T2 and in S2, T3 is reading A updated by T1. 3. Final WriteA final write must be the same between both the schedules. In schedule S1, if a transaction T1 updates A at last then in S2, final writes operations should also be done by T1. Above two schedules is view equal because Final write operation in S1 is done by T3 and in S2, the final write operation is also done by T3. Example: Schedule S With 3 transactions, the total number of possible schedule = 3! = 6 S1 = <T1 T2 T3> S2 = <T1 T3 T2> S3 = <T2 T3 T1> S4 = <T2 T1 T3> S5 = <T3 T1 T2> S6 = <T3 T2 T1> Taking first schedule S1: Schedule S1 Step 1: final updation on data items In both schedules S and S1, there is no read except the initial read that's why we don't need to check that condition. Step 2: Initial Read The initial read operation in S is done by T1 and in S1, it is also done by T1. Step 3: Final Write The final write operation in S is done by T3 and in S1, it is also done by T3. So, S and S1 are view Equivalent. The first schedule S1 satisfies all three conditions, so we don't need to check another schedule. Hence, view equivalent serial schedule is: T1 → T2 → T3
Next TopicDBMS Recoverability of Schedule
|