Open In App

Condition of schedules to be View-equivalent

Last Updated : 23 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

In a database system, a schedule is a sequence of operations (such as read and write operations) performed by transactions in the system. Serial or one by one execution of schedules has less resource utilization and low throughput. To improve it, two or more transactions are run concurrently.

  • View Serializability guarantees that even though transactions run concurrently, their outcome will be identical to the result achieved if the transactions were executed one by one in a specific order.
  • It is a concept in concurrency control that determines whether a non-serial schedule can be rearranged to act like a serial schedule without conflicts.
  • It ensures data consistency and integrity when multiple transactions are executed at the same time.

View Serializable and View Equivalent

A schedule is view serializable if it is view equivalent to a serial schedule. In simple terms:

  • Serial Schedule: Transactions are executed one after another without interleaving.
  • View Equivalent: Two schedules are view equivalent if they produce the same final state of the database and ensure the same read/write behavior for all transactions.

A schedule S1 is said to be view-equivalent to a schedule S2 if and only if:

  • The order of any two conflicting operations in S1 is same as the order of those operations in S2. A conflicting operation is an operation that accesses the same data item as another operation and at least one of the operations is a write operation.
  • The order of any two non-conflicting operations can be interchanged without changing the results produced by the schedules.
  • In other words, two schedules are view-equivalent if they produce the same results regardless of the order in which non-conflicting operations are executed, and the order of conflicting operations is the same in both schedules.
  • If two schedules are view-equivalent, it means that they are interchangeable in terms of their results, and the system can choose to execute either one without affecting the consistency or correctness of the database.

View-equivalence is indeed a weaker condition than conflict serializability. While conflict serializability strictly enforces the order of conflicting operations (like reads and writes on the same data), view equivalence focuses on ensuring that the outcome of the schedule is identical to that of a serial schedule, regardless of the exact operation order.

This weaker condition allows more concurrency and flexibility in executing transactions, as long as:

  1. The first read of a data item matches the corresponding read in the serial schedule.
  2. The final writes to each data item are the same as in the serial schedule.
  3. The intermediate reads are consistent with the corresponding writes.

Two schedules S1 and S2 are said to be view-equivalent if the below conditions are satisfied : 

1.Initial Reads: If in schedule S, transaction Ti reads the initial value of Q, then in schedule S’ also transaction Ti must read the initial value of Q. For example, if transaction T1 reads data item A in schedule S, then in schedule S', T1 must also read A as its first operation to maintain consistency.

initial_Read
Initial Read

2.Intermediate/Updated Reads: If in a schedule S, a transaction Ti executes executes read(Q), and that value was produced by transaction Tj (if any), then in schedule S’ also transaction Ti must read the value of Q that was produced by the same write(Q) operation of transaction Tj. For example, if T3 reads the value of B updated by T2 in schedule S then in S', T3 must read the value of B updated by T2.

updated_read
Updated Read

3.Final Update: The transaction (if any) that performs the final write(Q) operation in schedule S must also perform the final write(Q) operation in schedule S’. For example, if T3 is the last transaction to write to A in schedule S, then T3 must also be the last transaction to write to A in schedule S'

final_update
Final Write

Steps to find View Serializable

Step 1- Find if schedule is conflict serializable or not.

Step 2- Find the possible serial schedule -> 3!

Step 3- Choose one of them and check for view equivalent conditions.

Step 4- If view equivalent schedule matches the condition, it is view serializable.

Example of View Serializable Schedule

StepTransactionOperationExplanation
1T1W(A)T1 writes to A.
2T2R(A)T2 reads the value of A written by T1.
3T2W(B)T2 writes to B.
4T1R(B)T1 reads the value of B written by T2.

 Serial Schedule Equivalent

StepTransaction Operation Explanation
1T1W(A)T1 writes to A.
2T1R(B)T1 reads the value of B, but T2 has not yet written to B, ensuring consistency.
3T2R(A)T2 reads the value of A written by T1, maintaining the correct order.
4T2W(B)T2 writes to B.
  • Condition 1: Initial Reads Match
    T2 reads A, which was written by T1, consistent with the serial schedule T1→T2.
  • Condition 2: Final Writes Match
    The final write to A and B in the schedule matches the serial schedule T1→T2.
  • Condition 3: Intermediate Reads Are Consistent
    T1 reads B after T2 writes to it, maintaining consistency.

Conclusion

View serializability ensures that a schedule is consistent and produces the same results as a serial schedule. It allows more flexibility than conflict serializability by focusing on the outcome rather than the exact order of operations. View-equivalent schedules maintain the same initial reads, intermediate reads, and final writes as the serial schedule, ensuring the integrity of the database while supporting concurrency. This approach is useful for optimizing transaction execution while preserving consistency.


Similar Reads