Transaction Schedule or History
When transactions are executing concurrently in an interleaved fashion, the order of execution of instructions from the various transaction as transaction schedule.
A schedule S of n transactions t1,t2,t3,... tn, is an ordering of the operations of the transaction subject to consistent that, for each transaction t1 that participate in S, the operation of t1 in S must appear in the same order in which they occur in t1.
However, those operations from another transaction tj can be interleaved with the operations.
The classification of the schedule is given bellow.
A schedule s is serial if, for every transaction T participating in the schedule, all the operations of T are executed consecutively in the schedule.
suppose there are two users that submit their transactions T1 and T2 at approximately the same time. If no interleaving is permitted, then there are only two possible out comes.
Execute all operations of transaction T1 and then execute all operations of transaction T2.
Execute all operations of transaction T2 and then execute all operations of transaction T1.
In a serial schedule only one transaction at a time is active.
A commit or abort of the active transaction initiates execution of the next transaction.
No interleaving occurs in a serial schedule.
Serial Execution is so far the simplest method to execute transactions. No extra work is required to ensure consistency.
Non Serial Schedule
A Schedule is non-serial if, for every transaction T participating in the schedule, the operation of T are executed in an interleaved manner with the operations of there transaction in the schedule.
Let us consider transaction T1 and T2
T1: R(X); w(X);R(y);W(Y); committed.
Serializability of the schedule
The concept of serializability of schedules used to identify which schedule are correct, when transaction execution has interleaving of there operations in the schedule.
A schedule S of n Transactions is serializable. If it is equivalent to some serialization schedule of the same n transactions. then when are the two schedules equivalent?
Two Schedules are Result Equivalent if they produce the same final state of the database. In the following example Schedules S1 and Schedule s2 are Result Equivalent for x=100 but not in general:
Two schedules are said to be conflict equivalent if the order of two conflicting operations is the same in both schedules. The example is given below; see:
T1 T2 T1 T2
Serial Schedule (S) Non Serial Schedule (S1)