Skip to content
Official PYQ · 2016

GATE CS 2016 Set 2 Q22 — Transactions and Concurrency Control

Explain with AI

Suppose a database schedule SS involves transactions T1,…,TnT_1,\ldots,T_n . Construct the precedence graph of SS  with vertices representing the transactions and edges representing the conflicts. If SS is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?

Choose one option
View worked solution

Answer: A

A schedule SS is conflict-serializable if and only if its precedence graph (also known as the serialization graph) is acyclic (i.e., a Directed Acyclic Graph or DAG).

In the precedence graph:

  • Vertices represent the transactions T1,T2,…,TnT_1, T_2, \dots, T_n.
  • A directed edge Ti→TjT_i \to T_j exists if there is a conflict between an operation in TiT_i and a subsequent operation in TjT_j, meaning TiT_i must execute before TjT_j in any equivalent serial schedule.

For any DAG, a topological sort produces a linear ordering of its vertices such that for every directed edge u→vu \to v, vertex uu appears before vv in the ordering. Therefore, the topological order of the precedence graph is guaranteed to yield a conflict-equivalent serial schedule.

Why the other options are incorrect:

  • Depth-first order (B) and Breadth-first order (C): These are graph traversal strategies. The order in which they visit vertices depends on the starting node and the graph structure, and they do not guarantee that for every edge u→vu \to v, uu is output before vv.
  • Ascending order of transaction indices (D): The transaction indices (like T1,T2,…T_1, T_2, \dots) are arbitrary labels and do not reflect the actual conflict dependencies of the schedule.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Transactions and Concurrency Control questions