# Result Serializability in DBMS

Prerequisite – Serializable Schedules

**Equivalence of Schedules :**

A schedule is a way of representing the order in which the operations of transactions get executed. Based on different properties related to the schedules such as end result, the order of execution of transactions two schedules might be equivalent. Equivalence of schedules is classified broadly in the following three categories –

- Result Equivalence
- Conflict Serializability in DBMS
- View Serializability in DBMS

**Result Serializability in DBMS :**

It is also known as Result Equivalent Schedule.

Two schedules S1 and S2 are said to be result equivalent if they produce the same final database state, in other words, they must produce the same result after execution. This type of equivalence is given the least importance as two schedules may produce the same result for some set of operations and different results for other sets.

**Example-1:**

Let us consider the following schedules S1 and S2 and check for result equivalence on initial values of X and Y as 2 and 5 respectively.

**Schedule S1 –**

T1 | T2 |
---|---|

R(X) | |

X=X+5 | |

W(X) | |

R(Y) | |

Y=Y+5 | |

W(Y) | |

R(X) | |

X=X*3 | |

W(X) |

**Schedule S2 –**

T1 | T2 |
---|---|

R(X) | |

X=X+5 | |

W(X) | |

R(X) | |

X=X*3 | |

W(X) | |

R(Y) | |

Y=Y+5 | |

W(Y) |

In both the above schedules, final values on substituting X and Y as 2 and 5 respectively are **X=21 AND Y=10**.

Thus, S1 and S2 are **Result Equivalent Schedules.**

**Example-2:**

Let us consider the following schedules S1 and S2 and check for result equivalence on initial values of X and Y as 3 and 6 respectively,

**Schedule S1 –**

T1 | T2 |
---|---|

R(X) | |

X=X+1 | |

W(X) | |

R(Y) | |

Y=Y*2 | |

W(Y) | |

R(X) | |

X=X*3 | |

W(X) |

**Schedule S2 –**

T1 | T2 |
---|---|

R(X) | |

X=X+1 | |

W(X) | |

R(Y) | |

Y=Y*2 | |

W(Y) |

In both the above schedules, final values on substituting X and Y as 3 and 6 respectively are –

- For S1, X = 12 and Y = 12
- For S2, X = 4 and Y = 12

The final values after complete execution of the schedules are different in both the schedules. This is because they both have different sets of operations. Thus, S1 and S2 are **not Result Equivalent Schedules**.