We already discussed how to check whether the given schedules are conflict serializable or not. It was fun doing that. We need to make a transition graph and check if there is a cycle or not?
If we get
Cycle then -----> NO conflict
No cycle -----> Conflict.
Checking View Serializability is a little bit tricky thing.
- If a transaction is a Conflict Serializable then it is definitely View Serializable but the reverse may not be true.
- If a transaction is not conflict serializable then check for Blind Write.
- If there is no blind write then NOT View Serializable.
- If Blind Write then Polygraph Test.
- Polygraph Test pass then View Serializable
We already know the theory what is View Serializable, So let's talk about how to solve questions in the exam. Basically, in Exam, they will ask you to find to out which one is View Serializable.
The trick for the Polygraph Test:
Consider every given transaction as a node in the graph.
Step 1: for every data item first see which one is the first transaction to read it. let' say some transaction tx is the first one to read it. then you draw outgoing edges from this node to all other transaction except tx.
Step 2: If ty is the transaction which is the last one to perform write operations on that data item, then towards ty you draw incoming edges from all the others transitions.
Step3: Now you check dependency between the transaction and draw edges accordingly like you did while checking for Conflict Serializable.
Now if you see any cycle the no view and
no cycle means View.