• edited by
19,934 views
23 23 votes

​​​​Consider the following read-write schedule $\text{S}$ over three transactions $T_{1}, T_{2}$, and $T_{3}$, where the subscripts in the schedule indicate transaction IDs:

$S: r_{1}(z) ; w_{1}(z) ; r_{2}(x) ; r_{3}(y) ; w_{3}(y) ; r_{2}(y) ; w_{2}(x) ; w_{2}(y) ;$

Which of the following transaction schedules is/are conflict equivalent to $\text{S}$?

  1. $T_{1} T_{2} T_{3}$
  2. $T_{1} T_{3} T_{2}$
  3. $T_{3} T_{2} T_{1}$
  4. $T_{3} T_{1} T_{2}$

3 Answers

Best answer
30 30 votes

$\begin{array}{c|c|c} \hline 
\bf{T_1} & \bf{T_2}& \bf{T_3} \\ \hline
r_1(z)\\
w_1(z) \\
&r_2(x) \\
&&r_3(y) \\
&&w_3(y) \\
&r_2(y)\\ &w_2(x)\\ &w_2(y)\\ \hline
\end{array}$

 

 

The corresponding polygraph for the given transaction. it has three conflict pairs as $T_3\rightarrow T_2$ as $r_3(y)\rightarrow w_2(y),w_3(y)\rightarrow r_2(y),w_3(y)\rightarrow w_2(y)$.
Because the graph is acyclic it is conflict serializable schedule and its corresponding conflict equal schedule is based on the topological order of the given graph.

Therefore, the following are possible serial schedules:

  1. $T_1,T_3,T_2$
  2. $T_3,T_1,T_2$
  3. $T_3,T_2,T_1$

Option $(B, C, D)$ are correct.

• edited by
2 2 votes
Here for this question, first we need to understand the conflict pairs which may occur. They are R(x)-W(x), R(y)-W(y), R(z)-W(z), W(x)-W(x), W(y)-W(y), W(z)-W(z), W(x)-R(x), W(y)-R(y), W(z)-R(z).

Now we need to create a precedence graph for the given schedule. Upon creating the graph we see that there is only one conflict pair present i.e. between T2 and T3 and there is no cycle or loop in the graph. This means the schedule is conflict serializable.

Since only T2 and T3 are involved in the conflict so the transaction schedule will be independent of T1's position.

It needs to be understood, that for choosing the transaction from the graph we have to consider the indegree of each transaction(node). We will have to start with the node having least indegree and then choose accordingly. This is why T2 cannot happen before T3 because indegree of T3 is 0 while that of T2 is 1.

So the possible transaction schedules are: B. T1-T3-T2

                                                                     C. T3-T2-T1

                                                                     D. T3-T1-T2

 

Note: Indegree is the number of incoming arrows in that node.
Answer:
Position:
Show:

Related questions

29 29 votes
8 8 answers
15.9k
15.9k views
Arjun asked Feb 16, 2024
15,902 views
​The symbol $\rightarrow$ indicates functional dependency in the context of a relational database. Which of the following options is/are TRUE?$(X, Y) \rightarrow(Z, W)$ i...
58 58 votes
8 answers 8 answers
30.5k
30.5k views
Arjun asked Feb 16, 2024
30,489 views
Which of the following statements about a relation $\mathbf{R}$ in first normal form $\text{(1NF)}$ is/are TRUE?$\mathbf{R}$ can have a multi-attribute key$\mathbf{R}$ ca...
42 42 votes
8 8 answers
21.1k
21.1k views
Arjun asked Feb 16, 2024
21,080 views
​​​​Let $G$ be a directed graph and $T$ a depth first search $\text{(DFS)}$ spanning tree in $G$ that is rooted at a vertex $v$. Suppose $T$ is also a breadth first searc...
23 23 votes
2 2 answers
13.7k
13.7k views
Arjun asked Feb 16, 2024
13,745 views
Consider a Boolean expression given by $\text{F(X, Y, Z)}=\sum(3,5,6,7)$.Which of the following statements is/are CORRECT?$\text{F(X, Y, Z)}=\Pi(0,1,2,4)$ $\text{F(X, Y, ...