Question
Suppose a database schedule involves transactions . Construct the precedence graph of with vertices representing the transactions and edges representing the conflicts. If is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2016 answer key
Solution
Relate conflict serializability of a database schedule to the topological sort of its precedence graph.
The precedence graph (or serialization graph) for a schedule is a directed graph where:
- The vertices represent the committed transactions .
- A directed edge exists if there is a conflict operation in that precedes a conflicting operation in .
By the Conflict Serializability Theorem, schedule is conflict serializable if and only if its precedence graph is acyclic (a DAG).
A topological sort of a DAG produces a linear ordering of its vertices such that for every directed edge , vertex comes before vertex in the ordering.
Executing the transactions sequentially in topological order preserves the order of all conflicting operations in , thereby yielding an equivalent serial schedule.
Therefore, a Topological order is guaranteed to yield a valid serial schedule (option A).
A
Choosing ascending index order, which is completely arbitrary and ignores the conflict edges.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2016 Computer Science and Information Technology (CS) Session 2
- Question
- 32 of 65, printed as CS Q.22
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.