0% found this document useful (0 votes)
21 views36 pages

Characterizing Serializability

The document discusses serializable schedules and equivalence of schedules in database transactions. It defines serializability, conflict equivalence, and view equivalence. It also discusses precedence graphs for determining if a schedule is conflict serializable.

Uploaded by

niveditam0104
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views36 pages

Characterizing Serializability

The document discusses serializable schedules and equivalence of schedules in database transactions. It defines serializability, conflict equivalence, and view equivalence. It also discusses precedence graphs for determining if a schedule is conflict serializable.

Uploaded by

niveditam0104
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

 If no interleaving of operations is permitted,

there are only two possible outcomes:


1.Execute all the operations of transaction T (in
1

sequence) followed by all the operations of


transaction T2 (in sequence).
2.Execute all the operations of transaction T2
(in sequence) followed by all the operations of
transaction T (in sequence).
1
 Interleaving of operations is allowed
 Limit concurrency by prohibiting interleaving
of operations.
 If a transaction waits for an I/O operation to
complete, we cannot switch the CPU
processor to another transaction , thus
wasting valuable CPU processing time.
 If some transaction T is quite long, the other
transactions must wait for T to complete all
its operations before starting.
 Serial Schedules are not acceptable.

 Hence determine schedules that are


equivalent to a serial schedule
 Used to identify which schedules are correct
when transaction executions have
interleaving of their operations in the
schedules.
 A schedule S of n transactions is serializable
if it is equivalent to some serial schedule of
the same n transactions
 Schedule or history
◦ Order of execution of operations from all
transactions
◦ Operations from different transactions can be
interleaved in the schedule

 Total ordering of operations in a schedule


◦ For any two operations in the schedule, one must
occur before the other
 A shorthand notation for describing a
schedule uses the symbols
 b - begin_transaction
 r- read_item
 w- write_item
 e- end_transaction
 c – commit
 a-abort
Schedule Sa: r1(X); r2(X); w1(X); r1(Y); w2(X); w1(Y);
 Two operations in a schedule are said to
conflict if they satisfy all three of the
following conditions:

1.they belong to different transactions


2.they access the same item X
3.At least one of the operations is a write_item(X)

Two operations are conflicting if changing


their order can result in a different
outcome
 For example, in schedule Sa,
the operations r (X) and w2(X) conflict, as do
1

the operations r2(X) and w1(X), and the


operations w1(X) and w2(X).
 Two types of Conflict
1.Read-write Conflict
Eg: If we change the order of the two
operations r1(X);w2(X) to w2(X); r1(X), then
the value of X that is read by transaction T
1

changes,
2.Write-Write Conflict
 Eg: If we change the order of two operations
such as w1(X); w2(X) to w2(X); w1(X).
1. The operations in S are exactly those
operations in T1, T2, ..., Tn, including a commit
or abort operation as the last operation for
each transaction in the schedule.
2. For any pair of operations from the same
transaction Ti, their relative order of
appearance in S is the same as their order of
appearance in Ti.
3. For any two conflicting operations, one of
the two must occur before the other in the
schedule.
 Since every transaction has either committed
or aborted, a complete schedule will not
contain any active transactions at the end of
the schedule.
 Result Equivalence
 View Equivalence
 Conflict Equivalence
 Two schedules are called result equivalent if
they produce the same final state of the
database.
 The schedules S and S2 will produce the same
1

final database state if they execute on a


database with an initial value of X = 100.
 For other initial values of X, the schedules are
not result equivalent.
 Hence, result equivalence alone cannot be
used to define equivalence of schedules.
 Two schedules are said to be conflict
equivalent if the order of any two conflicting
operations is the same in both schedules.
 Example:
 We define a schedule S to be conflict
serializable if it is (conflict) equivalent to
some serial schedule S.
 In both schedules, the read_item(X) of T2
reads the value of X written by T1, while the
other read_item operations read the
database values from the initial database state.

 Additionally, T1 is the last transaction to write


Y, and T2 is the last transaction to write X in
both schedules
 Can be done by constructing a precedence
graph (or serialization graph).
 It is a directed graph G = (N, E) that consists
of a set of nodes N = {T1, T2, ..., Tn } and a set
of directed edges E = {e ,e2, ..., em }.
1
 View Equivalent:Two schedule S and S’ are
view equivalent if following conditions hold

You might also like