Skip to main content

GATE CSE 2017Databases › Transactions, Concurrency Control & IndexingVerified

GATE CSE 2017 PYQ: Two transactions T 1 T_1 T 1 ​ and T 2 T_2 T 2 ​ are given as T 1 : r 1 ( X ) w 1 ( X ) r 1 ( Y ) w 1 ( Y )…

Two transactions T1T_1 and T2T_2 are given as

T1:r1(X)w1(X)r1(Y)w1(Y)T_1:r_1(X)w_1(X)r_1(Y)w_1(Y)

T2:r2(Y)w2(Y)r2(Z)w2(Z)T_2:r_2(Y)w_2(Y)r_2(Z)w_2(Z)

where ri(V)r_i(V) denotes a read\textit{read} operation by transaction TiT_i on a variable VV and wi(V)w_i(V) denotes a write\textit{write} operation by transaction TiT_i on a variable VV. The total number of conflict serializable schedules that can be formed by T1T_1 and T2T_2 is ______

    Answer

    54

    Approach

    The only data item shared by both transactions is Y (T1 touches X and Y, T2 touches Y and Z). Since conflict serializability is decided purely by conflicting operation order, we enumerate the schedules equivalent to the two possible serial orders: T1 → T2 and T2 → T1.

    Only operations on Y conflict, so the conflict-serializable schedules are exactly those equivalent to T1 → T2 (just 1) or to T2 → T1 (53), giving 54.

    Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.