Given schedule is conflict serializable or not exercise, Conflict serializability exercise, how to find whether a schedule is conflict serializable? conflict serializability example
Conflict Serializable Schedule  Solved Exercise
Question:
Consider a schedule S with two
transactions T_{1}, T_{2}, T_{3} and T_{4} as
follows;
S: R_{2}(x); W_{3}(x);
W_{1}(x); W_{2}(y); R_{2}(y); R_{4}(x); R_{4}(y);
Is the schedule S conflict serializable?
Solution:
Conflict
serializable schedule: A schedule is conflict serializable if it can be transformed into an
equivalent serial schedule by swapping pairs of nonconflicting instructions.
Two instructions conflict if
they involve the same data item and at least one of them is a WRITE.

The schedule S given in questions is
as follows;
Instruction

T_{1}

T_{2}

T_{3}

T_{4}

1
2
3
4
5
6
7

W(x)

R(x)
W(y)
R(Z)

W(x)

R(x)
R(y)

We can construct a precedence graph
to decide whether the given schedule is conflict serializable or not.
Precedence graph can be constructed
by carefully analyzing the conflicting instructions. For every conflicting
instruction, an edge can be inserted into the precedence graph. At the end, if
the graph has not formed a cycle, then we would say that the schedule S is conflict
serializable, otherwise not.
Conflicting
instruction and
the edge to be
inserted

Precedence graph


R_{2}(x)
and W_{3}(x);
T_{2} → T_{3}

➔


R_{2}(X) and
W_{1}(X);
T_{2} → T_{1}

➔


W_{3}(X) and
W_{1}(X);
T_{3} → T_{1}

➔


W_{3}(X) and
R_{4}(X);
T_{3} →
T_{4}

➔


W_{1}(X) and
R_{4}(X);
T_{1} → T_{4}

➔


W_{2}(Y) and
R_{4}(Y);
T_{2} → T_{4}

➔

From the precedence graph, it is
clear that no cycle has been formed through the conflicting instructions. Hence,
the schedule is a conflict serializable schedule.
***********
Go to Define Serializability page
Go to Solved exercises in DBMS page
Conflict serializability solved exercise
conflict serializable schedule example
how to find whether a schedule is conflict serializable or not?
how to check a schedule is serializable or not?
use precedence graph for checking serializability
serializability solved exercise
concurrency and serializability
No comments:
Post a comment