Normalization For Relational Database Part 5 88
Normalization For Relational Database Part 5 88
co
1
www.gradeup.co
Content :-
1. Serializability
2. Type of Schedules
3. Conflict Serializability
4. View Serializability
When several transactions are executing concurrently then the order of execution of various
instructions is known as a schedule .
For identifying which schedules are connected when transaction executions have interleaved
their operations in the schedule then the concept of serializability of schedule is used .
Types of Schedules
1. Serial Schedules
2. Non-serial Schedules
3. Conflict Schedules
4. View Schedules
Schedule A Schedule B
To schedule A and B are called serial schedule if the operations of each transaction are
executed consecutively , without any interleaved operations from the other transaction . In
serial schedule, entire transaction are performed in the serial other T1 and then T2 or T2 and
then T1 .
2
www.gradeup.co
Conflict Schedule :- The graph which contains no cycle is called conflict serialization
schedules.
If the precedence graph for S has a cycle , then the schedule S is not a conflict serializable.
“if graph contain no cycle then the schedule is conflict serializable”
Testing of Serializability :
For testing of serializability the simple and efficient method is to construct a directed graph ,
called a precedence graph of S.
G= (V,E)
All the transactions participating in the schedule are denoted by the set of vertices. The set
of edges consists of all edges Ti→Tj of which one of three conditions holds:
1. Ti executes write(Q) before Tj executes read(Q)
2. Ti executes read(Q) before Tj executes write(Q)
3. Ti executes write(Q) before Tj executes write(Q)
Example :-
T1 T2 T3
Read(X)
Write(X)
Write(X)
Write(X)
3
www.gradeup.co
Thus, only in the case where both Ii and Ij are read instructions does the relative order is their
execution does not matter.
We say that Ii and Ij conflict if they are operations by transactions on the same data item and
at least one of these instructions is a write operation
If schedule S can be transferred into a schedule S’ by a series of swap of non-conflicting
instructions , we say that S and S’ are conflict equivalent .
The concept of conflict equivalence leads to the concept of conflict serializability. We say that
a schedule S is conflict serializability if it is conflict equivalent to a serial schedule .
View Serializability :- consider two schedule S1 and S2 where same set of instructions
participate in both schedules . The schedule S and S are said to be view equivalent if the
following conditions are met :
1. For each data item X , if transaction T1 reads the initial value of X in the schedule S1 , the
transaction T1 must in schedule S2 also read the initial value of X.
2. For each data item X, if transaction T1 executes read(A) in schedule S1 and the value was
produced by transaction Tj (if any ) , then transaction Ti must in schedule S2 also read the
value of X was produced by transaction Tj .
3. For each data item X , the transaction (if any) that performs that final write(X) operation
in schedule S1 must perform the final write(X) operation schedule S2 .
The concept of view equivalence leads to the concept of view serializability. We say that
schedule S is view serializabilty if it is view equivalence to a serial schedule.
Every conflict-serializability schedule is also view serializiable but there are view serializable
schedule that are not conflict serializable.
4
www.gradeup.co