Schedules in DBMS-
Before you go through this article, make sure that you have gone through the previous article on Serializability in DBMS.
We have discussed-
- The concept of serializability helps to identify the correct non-serial schedules that maintains the consistency of the database.
- There are two types of serializability-
In this article, we will discuss about View Serializability.
|If a given schedule is found to be view equivalent to some serial schedule, then it is called as a view serializable schedule.|
Also read- Schedules in DBMS
View Equivalent Schedules-
Consider two schedules S1 and S2 each consisting of two transactions T1 and T2.
Schedules S1 and S2 are called view equivalent if the following three conditions hold true for them-
For each data item X, if transaction Ti reads X from the database initially in schedule S1, then in schedule S2 also, Ti must perform the initial read of X from the database.
“Initial readers must be same for all the data items”.
If transaction Ti reads a data item that has been updated by the transaction Tj in schedule S1, then in schedule S2 also, transaction Ti must read the same data item that has been updated by the transaction Tj.
“Write-read sequence must be same.”.
For each data item X, if X has been updated at last by transaction Ti in schedule S1, then in schedule S2 also, X must be updated at last by transaction Ti.
“Final writers must be same for all the data items”.
Checking Whether a Schedule is View Serializable Or Not-
Check whether the given schedule is conflict serializable or not.
- If the given schedule is conflict serializable, then it is surely view serializable. Stop and report your answer.
- If the given schedule is not conflict serializable, then it may or may not be view serializable. Go and check using other methods.
Check if there exists any blind write operation.
(Writing without reading is called as a blind write).
- If there does not exist any blind write, then the schedule is surely not view serializable. Stop and report your answer.
- If there exists any blind write, then the schedule may or may not be view serializable. Go and check using other methods.
No blind write means not a view serializable schedule.
In this method, try finding a view equivalent serial schedule.
- By using the above three conditions, write all the dependencies.
- Then, draw a graph using those dependencies.
- If there exists no cycle in the graph, then the schedule is view serializable otherwise not.
Next Article- Practice Problems On View Serializability
Get more notes and other study material of Database Management System (DBMS).
Watch video lectures by visiting our YouTube channel LearnVidFun.