- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Check whether two schedules are view equal or not(DBMS)
There are two types of serializability which are as follows −
A schedule is view-serializability if it is view equivalent to a serial schedule.
The rules it follows are given below −
T1 is reading the initial value of A, and then T2 also reads the initial value of A.
T1 is the reading value written by T2, and then T2 also reads the value written by T1.
T1 is writing the final value, and then T2 also has the write operation as the final value.
It orders any conflicting operations in the same way as some serial execution. A pair of operations is said to conflict if they operate on the same data item and one of them is a write operation.
Readi(x) readj(x) - non conflict read-read operation
Readi(x) writej(x) - conflict read-write operation.
Writei(x) readj(x) - conflict write-read operation.
Writei(x) writej(x) - conflict write-write operation.
Now let us find out whether the schedules are view equal or not.
A schedule is view-serializability, if it is view equivalent to a serial schedule. A schedule is view serializable, if following three rules are satisfied −
Rule 1 − if Ti reads data initially, after this Tj writes the same data, in the given schedule. This sequence must be followed in the transaction combination (read write operation).
Rule 2 − if Ti writes data initially, after this Tj reads the same data, in the given schedule. This sequence must be followed in the transaction combination (write read operation).
Rule 3 − if Ti writes data, after this Tj writes the data finally. This sequence must be followed in the transaction combination (write-write operation).
R1(X) W2(X) W1(X), create all possible combinations of the transactions. We have 2 transactions, so the combinations are− <T1, T2> and <T2, T1>.
Rule 1 − T1 reads initially, after this T2 writes the same data, that means the transaction sequence must be “T1 followed by T2”. So remove following combination where “T1 is not followed by T2” i.e. <T2, T1>
Rule 2 − T2 writes initially, after this no transaction reads the same data. So we keep all the transaction combinations, that means rule 2 does not remove any combinations.
Rule 3 − T1 writes data finally, that means T1 must occur at last, so remove following combinations where “t1 does not occur at last”. <T1, T2>
Hence, no combination left to satisfy the view serializability.
The given schedule is not view-serializable.
- Check if the given schedules are view serializable(DBMS)
- Check the view serializability for the given schedules(DBMS)
- Check if two strings are equal or not in Arduino
- Check whether two HashSet are equal in Java
- Check if two StringDictionary objects are equal or not in C#
- Java Program to check whether two Strings are an anagram or not.
- C# program to check whether two sequences are the same or not
- Program to check whether two sentences are similar or not in Python
- Program to check whether two string arrays are equivalent or not in Python
- Check whether two strings are equivalent or not according to given condition in Python
- 8085 program to check whether both the nibbles of 8 bit number are equal or not
- Python Pandas – Check if any specific column of two DataFrames are equal or not
- Program to check whether leaves sequences are same of two leaves or not in python
- Program to check whether we can make group of two partitions with equal sum or not in Python?
- Python Pandas - Check if the dataframe objects are equal or not