2.6 KiB
Conflict Serialisability
If a concurrent schedule organises conflicting operations in the same way as a serial schedule, the results are the same. This is called conflict serialisability, which can be tested using precedence graphs.
Directed Graph
Precedence Graph
- Used to determine if a schedule is serialisable.
- It is serialisable if the graph has no cycles.
Example Using Serial Schedule
Example Using Non-Serial Schedule
- This schedule is serialisable due to being acyclic.
- It is equivalent due to
- T2 reading the written value of X from T1
- T1 reading the value of X from the database
- T1 is the last transaction to write Y
- T2 is the last transaction to write X
Example Using Non-Serialisable Schedule
Example 4
Tutorial Questions: Chapter 28
-
What is a serial schedule? A serial schedule is an order of operations where each is complete before a new operation starts. Ex. No interleaves operations.
-
Why is a serial schedule considered correct? Each operation is either successful or aborted before a new operation starts, meaning every operation is correct and the database is consistent.
-
What is a serialisable schedule? A serialisable schedule is a concurrent schedule with an acyclic precedence graph. The operation is the same as a serial schedule.
-
Why is a serialisable schedule considered correct? Since the operation is functionally the same as a serial schedule, we can consider it correct.
-
The precedence graph is serialisable since it is acyclic. No directed cycles.
-
T1.1 -> T2.2, T1.2 -> T2.1, T1.2 -> T2.2, T1.2 -> T3.1, T2.2 -> T3.1
- T2.1 -> T1.1, T1.1 -> T2.2, T2.2 -> T1.2
- T1.1 -> T2.1, T1.2 -> T2.1
- T1.1 -> T2.2, T2.1 -> T1.2, T1.2 -> T2.2