The Wayback Machine - https://web.archive.org/web/20240703040736/https://www.geeksforgeeks.org/view-serializability-in-dbms-transactions/
Open In App

Condition of schedules to View-equivalent

Last Updated : 13 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In a database system, a schedule is a sequence of operations (such as read and write operations) performed by transactions in the system. Two schedules are view-equivalent if they produce the same set of results when executed against the same database state.

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 the 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.

The condition of schedules to be view-equivalent is important because it determines whether two schedules can be considered equivalent for purposes such as concurrency control, recovery, and replication. 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 a weaker condition than conflict serializability, which requires that two schedules be equivalent in terms of the order in which transactions are executed. View equivalence allows for more concurrency and flexibility in scheduling, as long as the results produced by the schedules are the same.

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

1) Initial Read: If a transaction T1 reads data item A from the database in S1 then in S2 also T1 should read A from database. 

  T1     T2     T3
-------------------
        R(A)
 W(A)          
               R(A)
        R(B)

Transaction T2 is reading A from the database. 

2) Updated Read: If Ti is reading A which is updated by Tj in S1 then in S2 also Ti should read A which is updated by Tj.  

  T1     T2     T3         T1    T2    T3                   
-------------------       ----------------
 W(A)                    W(A)       
         W(A)                               R(A)
                 R(A)               W(A)

Above two schedules are not view-equivalent as in S1 :T3 is reading A updated by T2, in S2 T3 is reading A updated by T1. 

3) Final Write operation: If a transaction T1 updated A at last in S1, then in S2 also T1 should perform final write operations.  

 T1       T2        T1     T2            
------------    ---------------
 R(A)              R(A)
         W(A)     W(A)
 W(A)                    W(A)

Above two schedules are not view-equivalent as Final write operation in S1 is done by T1 while in S2 done by T2. 

View Serializability: A Schedule is called view serializable if it is view equal to a serial schedule (no overlapping transactions). 

 


Previous Article
Next Article

Similar Reads

Types of Schedules in DBMS
Schedule, as the name suggests, is a process of lining the transactions and executing them one by one. When there are multiple transactions that are running in a concurrent manner and the order of operation is needed to be set so that the operations do not overlap each other, Scheduling is brought into play and the transactions are timed accordingl
7 min read
Calculation of Serial and Non-Serial Schedules in DBMS
The serial execution of a transaction is defined as Schedule. It is made up of a number of transactions each comprising of a number of instructions. Types of Schedules - Serial SchedulesNon-Serial Schedules Calculation of Number of Schedules : Consider there to be n number of transactions t1, t2, t3, ...., tN with N1,N2,N3,.....Nn number of operati
2 min read
Types of Schedules based Recoverability in DBMS
In this article, we are going to deal with the types of Schedules based on the Recoverability in Database Management Systems (DBMS). Generally, there are three types of schedules given as follows: Schedules Based on RecoverabilityRecoverable Schedule: A schedule is recoverable if it allows for the recovery of the database to a consistent state afte
5 min read
Equivalent Serial Schedule of Conflict Serializable Schedule in DBMS
Prerequisite: Conflict Serializability, Precedence Graph Conflict Serializable Schedule: A schedule is called conflict serializable if it can be transformed into a serial schedule by swapping non-conflicting operations. The serial schedule of the Conflict Serializable Schedule can be found by applying topological Sorting on the Precedence Graph of
12 min read
Difference between Simple and Complex View in SQL
A View in SQL as a logical subset of data from one or more tables. Views are used to restrict data access. A View contains no data of its own but it is like a window through which data from tables can be viewed or changed. The table on which a View is based is called BASE Tables. There are 2 types of Views in SQL: Simple View and Complex View. Simp
2 min read
What is GAV (Global as View)?
There are many databases and data sources that need integration. Almost every application has many sources of data that can be used to work together. Data integration involves integrating data from various sources and it has a single view over the sources. It is done to answer queries using the information that’s been combined. It can be physical a
4 min read
Difference between Conflict and View Serializability
Prerequisite - Types of Schedules in DBMS Serializable Schedule : A transaction schedule is serializable if its outcome is equal to the outcome of its transactions executed serially i.e. sequentially without overlapping in time. A serializable schedule always leaves the database in consistent state. A serial schedule is always a serializable schedu
4 min read
Difference between View and Cursor in SQL
1. View : A view is a virtual table that not actually exist in the database but it can be produced upon request by a particular user. A view is an object that gives the user a logical view of data from a base table we can restrict to what user can view by allowing them to see an only necessary column from the table and hide the other database detai
3 min read
Local as View (LAV)
Local as View (LAV) is approach that view-based data integration systems (VDISs) use to perform data Integration i.e. searching and combining data from various sources. It describes each local schema as function over global schema. Here data sources are defined as views over provided schema. Schema is designed in such way that it maintains stabilit
4 min read
Creating Materialized View using Table definition in Cassandra
In this article, we are going to discuss how we can create a materialized view based on a particular problem and also cover the example for the same. Let's discuss one by one. Pre-requisite - Materialized view In this, you will see how you can create the materialized view based on table definition. Let's understand this by using the following steps
2 min read