← RGPV CS-502 DBMS November 2023 solved question paper
← RGPV CS-502 DBMS December 2020 solved question paper
RGPV CS-502 (GS) | November 2023 | Q7(a) | 7 marks
Question (restated): Construct the precedence graph for the supplied interleaving on A and B and determine whether a serial equivalent exists.
Answer
R1(A), R2(A), W2(A), R2(B), W1(A), R1(B), W1(B), W2(B)
A precedence graph has one vertex per transaction. Add Ti→Tj if an operation of Ti precedes a conflicting operation of Tj on the same item. Operations conflict if they belong to different transactions and at least one is a write.
| Conflict | Edge |
|---|---|
| R1(A) before W2(A) | T1 → T2 |
| R2(A) before W1(A) | T2 → T1 |
| W2(A) before W1(A) | T2 → T1 |
| R2(B) before W1(B) | T2 → T1 |
| R1(B) before W2(B) | T1 → T2 |
| W1(B) before W2(B) | T1 → T2 |
The graph has both directed edges and therefore contains a cycle. A schedule is conflict serializable exactly when its precedence graph is acyclic. Neither T1 followed by T2 nor T2 followed by T1 can preserve all conflict orders. Consequently there is no conflict-equivalent serial schedule.
The schedule also has different final writers on A and B: T1 is the final writer of A and T2 is the final writer of B. Since both transactions write both items, neither serial order preserves both final writers. Thus it is not view serializable either. The requested equivalent serial schedule does not exist for the supplied operation order.

Further reading: Silberschatz, Korth and Sudarshan, Database System Concepts; Elmasri and Navathe, Fundamentals of Database Systems.
December 2020 examination question
Describe construction of a precedence graph to test serializability.
A precedence graph is a directed graph used to test conflict serializability. Create a vertex for every transaction. Two operations conflict when they belong to different transactions, access the same item and at least one writes. For each conflict, draw an edge from the earlier transaction to the later transaction. Ignore read-read pairs.
For example, consider R1(A), W1(A), R2(A), W2(A), R2(B), W2(B), R3(B). The conflicts on A produce T1 → T2; those on B produce T2 → T3. The graph is acyclic and the equivalent serial order is T1, T2, T3. A topological sort gives such an order.
If an additional W3(A) precedes a later R1(A), an edge T3 → T1 closes a cycle. No conflict-equivalent serial order then exists. The test establishes conflict serializability, not necessarily view serializability or recoverability. Commit ordering must be checked separately.

Further reading: Silberschatz, Korth and Sudarshan, Database System Concepts.
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion