20 Schedules
20 Schedules
20 Schedules
AGENDA
• Schedules,
• Serializability (Conflict and View),
Schedules
• Schedule - a sequences of instructions that specify the
chronological order in which instructions of concurrent
transactions are executed
- a schedule for a set of transactions must consist of all
instructions of those transactions
- must preserve the order in which the instructions appear in
each individual transaction.
• A transaction that successfully completes its execution
will have a commit instructions as the last statement
- by default transaction assumed to execute commit
instruction as its last step
• A transaction that fails to successfully complete its
execution will have an abort instruction as the last
statement
Scheduling of Transactions
• 1.Complete Schedule: A schedule that contains
either an abort or a commit for each transaction
whose actions are listed in it is called a complete
schedule.
•
• 2.Serial Schedule:
• Each serial schedule consists of a sequence of
instructions from various transactions, where the
instructions belonging to one single transaction
appear together in that schedule. If the actions of
different transactions are not interleaved , we call
that schedule a serial schedule.
Schedule 1
Schedule 2
• 3.Non-Serial Schedule : A schedule in
which the operation from a set of
concurrent transaction are interleaved is
called a non-serial schedule .
T1 T2
A=A+100
A=A*7.06
B=B-100
B=B*7.06
• 4.Equivalent Schedule:
• For any database state the effect (on the set of
objects in the database) of executing the first
schedule is identical to effect of executing the
second schedule.
• Both schedule are equivalent
T1 T2 T1 T2
A=A+100 A=A+100
B=B-100 A=A*7.06
• A) B)
A=A*7.06 B=B-100
B=B*7.06
B=B*7.06
Schedule 3
Schedule 4
• 5.Serializiable Schedule: A non-serial schedule that
is equivalent to some serial execution of transactions
is called a serializiable schedule.
• For example schedule-3 is serializable schedule,
which is equivalent to schedule-1 and schedule-2.
• The objective of serializability is to find non-serial
schedules that allow transactions to execute
concurrently without interfering with one another,
and thereby produce a database state that could be
produced by a serial execution.
CONFLICTS OF OPERATIONS
• 2
• 3