# Check the view serializability for the given schedules(DBMS)

A schedule has view-serializability if it is viewed as equivalent to a serial schedule. A schedule is view serializable if the following three rules are satisfied −

• Rule 1 − If Ti reads data initially, after this Tj writes the same data, in the given schedule. This sequence must be followed in the transaction combination (read write operation).

• Rule 2 − If Ti writes data initially, after this Tj reads the same data, in the given schedule. This sequence must be followed in the transaction combination (write read operation).

• Rule 3 − If Ti writes data, after this Tj writes the data finally. This sequence must be followed in the transaction combination (write-write operation).

## Problem

Check the view serializability for the schedules W3(X), R2(X), W2(Y), R1(Z), W3(Y), W1(Y).

## Solution

We have three transactions, so the transaction combinations are as follows −

<T1, T2, T3>

<T1, T3, T2>

<T2, T1, T3>

<T2, T3, T1>

<T3, T1, T2>

<T3, T2, T1>

Here,

Rule 1 − T2 reads initially, after this number transaction writes the same data. So we keep all the transaction combinations.

Rule 2 − T3 writes initially, after this T1 reads the same data Z that means the transaction sequence must be “t3 followed by T1”. So remove the following combinations where “T3 is not allowed by T1”, that is T1 occurs before T3.

<T1, T2, T3>

<T1, T3, T2>

<T2, T1, T3>

Rule 3 − T1 writes data finally, that means T1 must occur at last. So remove following combination where “T1 does not occur at last”

<T3, T1, T2>

Hence, two combinations left to satisfy the view serializability are −

<T2, T3, T1>

<T3, T2, T1>

## Conclusion

The given schedule is view serializable.

Updated on: 06-Jul-2021

2K+ Views 