edited by
601 views

2 Answers

Best answer
4 votes
4 votes

Two schedules $S1$ and $S2$ are said to be view equal iff the three below conditions hold :

1. Final write : 

If any data item $I's$ final write/ updation has been done by Transaction $T_i$ in $S1$ then In $S2$ also final write/updation of $I$ must be done by $T_i$.

In the given schedule $S$, Item $B$ has been written by Two Transactions $T_1$ and $T_5$, and $T_5$ writes $B$ after $T_1$, So, In the Equivalent Serial schedule, $T_5$ must be after(not necessarily immediately) $T_1$.

2. Updated Read :

If $T_i$ is reading $I$ which is updated/written by $T_j$ in $S1$ then in $S2$ also $T_i$ should read $I$ which is updated by $T_j$.

So, In the given schedule, $T_2, T_4$ reads $B$ written by $T_1$,  $T_5$ reads $C$ written by $T_2$ and $T_5$ reads $E$ written by $T_4$

So, in the Equivalent Serial Schedule also, these orders must preserve.

i.e. $T2, T4$ must be after $T1$ (But $T5$ must not be there in between $T1$ and {$T2,T4$} because $T5$ also writes $B$ and if it is in between $T1$ and {$T2,T4$} somewhere then either $T2$ or $T4$ or both will read $B$ which will be writeen by $T5$...which will violate Updated read condition )

and $T5$ after $T2$ ;$T5$ after $T4$ (because $T_5$ reads $C$ written by $T_2$ and $T_5$ reads $E$ written by $T_4$ )

3. Initial Read : 

If a transaction $T_i$ is reading data item $I$ from initial database in $S1$ then in $S2$ also $T_i$ should read $I$ from initial database.

Here, Only Inital reads are $r_1(A), r_3(D)$ and Item $A,D$ are not writeen by any transactions, So, No problem at all to Initial read condition i.e. Whereever you keep $T_1$ and $T_3$, Initial read condition will hold.

So, Now, From all the conditions/orders obtained from the above conditions, We get the following Orders :

$T1\rightarrow \left \{ T2,T4 \right \}\rightarrow T5$ ; And $T3$ can be put anywhere.

So, We have $10$ possible Serial Schedules/Orders.

selected by
1 votes
1 votes
T1's WB is read by T2 and T4. So T1-->t2 or T4. Similarly t2->T5 and T4->T5.

Now the sequence can be as follows:

T1-> (T2,T4)-> T5.

Now t2,t4 can be arranged in 2 ways and t3 cn b3 inserted at any of five positions. So there 5*2=10 possible view serializable schedules.

Related questions

0 votes
0 votes
1 answer
1
Bharat patra asked Nov 25, 2018
1,867 views
Consider the following schedule :S:r1(A);w1(B);r2(A);w2(B);r3(A);w3(B);Here ri(X) denotes read on data item X and wi(X) denoted write on data item X .The total number of ...
2 votes
2 votes
1 answer
3
2 votes
2 votes
1 answer
4
shivangi5 asked Dec 4, 2017
1,803 views
Consider the following schedule:S:r1(a) r3(d) w1(B) r2(B) r4(B) w2(C) r5(C) w4(E) r5(E) w5(B)How many serial schedules conflict equal to schedules (S)?