View Equivalent Schedule in DBMS
View Equivalent Schedule in DBMS
Therefore,
The Schedule S1 and S2 are called View Equivalent serializable if it is
view equal to a serial schedule (no overlapping transactions).
View Serializable:
Step-01:
List all the conflicting operations and
determine the dependency between the transactions.
W1(B) , W2(B) (T1 → T2)
W1(B) , W3(B) (T1 → T3)
W1(B) , W4(B) (T1 → T4)
W2(B) , W3(B) (T2 → T3)
W2(B) , W4(B) (T2 → T4)
W3(B) , W4(B) (T3 → T4)
Problems Based on View Serializability- Problem-01
Clearly,
there exists no cycle in the precedence graph.
Therefore, the given schedule S is conflict serializable.
Thus, we conclude that the given schedule is also view
serializable.
Problems Based on View Serializability- Problem-02
Step-01:
List all the conflicting operations and
determine the dependency between the transactions.
R1(A) , W3(A) (T1 → T3)
R2(A) , W3(A) (T2 → T3)
R2(A) , W1(A) (T2 → T1)
W3(A) , W1(A) (T3 → T1)
Problems Based on View Serializability- Problem-02
Now,
• Since, the given schedule S is not conflict serializable,
so, it may or may not be view serializable.
• To check whether S is view serializable or not, let us
use another method.
• Let us check for blind writes.
Problems Based on View Serializability- Problem-02
Checking for Blind Writes (Without Read operation Directly doing Write Operation)
There exists a blind write W3 (A) in the given schedule S.
Therefore, the given schedule S may or may not be view serializable.
Now,
• To check whether S is view serializable or not, let us use another method.
• Let us derive the dependencies and then draw a dependency graph (or) Poly graph.
Problems Based on View Serializability- Problem-02
Clearly,
• there exists a cycle in the dependency graph.
• Thus, we conclude that the given schedule S is not view
serializable.
Problems Based on View Serializability- Problem-03
Step-01:
List all the conflicting operations and
determine the dependency between the transactions.
R1(A) , W2(A) (T1 → T2)
R2(A) , W1(A) (T2 → T1)
W1(A) , W2(A) (T1 → T2)
R1(B) , W2(B) (T1 → T2)
R2(B) , W1(B) (T2 → T1)
Problems Based on View Serializability- Problem-03
Solution-
if a schedule is conflict serializable, then it is
surely view serializable.
So, let us check whether the given schedule is conflict
serializable or not.
Step-01:
List all the conflicting operations and
determine the dependency between the transactions.
R1(A) , W2(A) (T1 → T2)
R1(A) , W3(A) (T1 → T3)
W2(A) , R3(A) (T2 → T3)
W2(A) , W1(A) (T2 → T1)
W2(A) , W3(A) (T2 → T3)
R3(A) , W1(A) (T3 → T1)
W1(A) , W3(A) (T1 → T3)
Problems Based on View Serializability- Problem-04
Step-01:
List all the conflicting operations and
determine the dependency between the transactions.
R1(A) , W2(A) (T1 → T2)
R1(A) , W3(A) (T1 → T3)
W2(A) , R3(A) (T2 → T3)
W2(A) , W1(A) (T2 → T1)
W2(A) , W3(A) (T2 → T3)
R3(A) , W1(A) (T3 → T1)
W1(A) , W3(A) (T1 → T3)
Step-02: Clearly, there exists a cycle in the precedence graph.
Draw the precedence graph Therefore, the given schedule S is not conflict serializable.
Now,
• Since, the given schedule S is not conflict serializable,
so, it may or may not be view serializable.
• To check whether S is view serializable or not, let us
use another method.
• Let us check for blind writes.
Problems Based on View Serializability- Problem-04
Checking for Blind Writes (Without Read operation Directly doing Write Operation)
There exists a blind write W2 (A) in the given schedule S.
Therefore, the given schedule S may or may not be view serializable.
Now,
• To check whether S is view serializable or not, let us use another method.
• Let us derive the dependencies and then draw a dependency graph.
Problems Based on View Serializability- Problem-04
Clearly,
• There exists no cycle in the dependency graph.
• Therefore, the given schedule S is view serializable.
• The serialization order T1 → T2 → T3.