Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the Difference between Conflict Serializable and Serializable?

My understanding is that conflict serializable implies serializable. I'm not sure how that makes them different. Does serializable mean conflict serializable?

like image 262
Astephen2 Avatar asked Dec 11 '13 20:12

Astephen2


2 Answers

Conflict serializable is a subset of serializable, so just because a schedule is conflict serializable does mean it is serializable.

See cow book Database Management System 2rd Ed Cha19.1.1 P541

Every conflict serializable schedule is serializable.

A serializable but not conflict serializable schedule is

T1 : R(A)       W(A) C
T2 :     W(A) C
T3 :                   W(A) C

This is not conflict serializable (by precedence graph) but is equivalent to serializable schedule

T1 T2 T3

because T3 blind writes the output in both schedule.

like image 194
fois Avatar answered Oct 01 '22 21:10

fois


Conflict serializability is a subset of serializability. If a schedule is conflict serializable, it is implied that this schedules is serializable.

It is computationally easier to determine if something is conflict serializable as opposed to just serializable. Simply construct a precedence graph. If the graph is non-cyclic, then this schuedule is conflict-equivalent to some serial schedule described by the pathing of the graph.

Imagine transactions A B and C, all writing to the same page. A writes, then B, then C, then A again. There is no serializable schedule that is conflict-equivalent. A must go first, because B and C have a conflict after A. But A must also go last, since B and C have a conflict before A. Hence the cycle in the graph.

But just because it is not conflict serializable does not mean it is not serializable. For example, if the last write of A was exactly the same as C's write, then ABC would be a serial schedule equivalent to the original, because the last write didn't end up mattering.

like image 23
755 Avatar answered Oct 01 '22 23:10

755