Serialization of schedules - Example - Database

Q.  In the table given below T1, T2 and T3 are the transactions.The correct serialization of the below schedules is
- Published on 19 Oct 15
computer-science-33.png


a. T2 -> T3 -> T1
b. T3 -> T2 -> T1
c. T1 -> T2 -> T3
d. T1 -> T3 -> T2

ANSWER: T1 -> T3 -> T2
 

    Discussion

  • Nirja Shah   -Posted on 29 Oct 15
    - T1 can complete before T2 and T3 as there is no conflict between Write(X) of T1 and the operations in T2 and T3 which occur before Write(X) of T1 in the above diagram.

    - T3 should complete before T2 as the Read(Y) of T3 doesn’t conflict with Read(Y) of T2.

    - Similarly, Write(X) of T3 doesn’t conflict with Read(Y) and Write(Y) operations of T2.

    - Another way to solve this question is to create a dependency graph and topologically sort the dependency graph.

    - After topologically sorting, we can see the sequence T1, T3, T2.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)