Multi-version protocol minimizes the delay for reading operation and maintains different versions of data items. For each writes operation performed, it creates a new version of transaction data so that whenever any transaction performs read operation to read that data then the appropriate created data version is selected by the control manager to make that read operation conflict-free and successful.
When the write operation and new version of data is created then that new version contains some information that is given below
- Content: This field contains the data value of that version.
- Write_timestamp: This field contains the timestamp of the transaction whose new version is created.
- Read_timestamp: This field contains the timestamp of the transaction of that transaction that will read that newly created value.
Now let us understand this concept using an example. Let T1 and T2 be two transactions having timestamp values 15 and 10, respectively.
The transaction T2 calls for a write operation on data (let’s say X) from the database. As T2 calls write operation, then a new version of data value X is created, which contains the value of X, timestamp of T2, and timestamp of that transaction which will read X, but in this case, no one is reading the newly created value so that filed remains empty.
X | 10 |
Now let the transaction T1 (having timestamp 15) call a read operation to read the newly created value X, then the newly created variable contained will be
X | 10 | 15 |
Now let’s discuss some important cases:
If timestamp of T2 is less than or equal to timestamp of T1 then
- Read(X) operation performed by T1: In this case, content of X is returned to T1.
- Write(X) operation performed by T1: In this case, T1 will be rolled back if timestamp of T1 is smaller than timestamp of read operation on X. And if timestamp of T1 is equal to the timestamp of write operation on X then the new version is created again with new contents.
Similar Reads
-
Aggregate function in SQL with Examples
In a Database Management System (DBMS), an aggregate function is a special tool that performs calculations on a set of… -
SQL and Parts of SQL language
SQL is a popular programming language, which is used to manage the relational databases and to perform various operations on… -
Views in Relational Algebra
In SQL, virtual table are considered as views. Like Tables, views also contain rows and columns. We can select the… -
Syntax of following SQL commands: sysdate, to date(), dual table ,to_number, substr() and initcap()
1. SYSDATE Purpose: SYSDATE is a function that returns the current date and time of the database server. Syntax SELECT… -
What is Super key, Candidate key and Primary key?
1. Super Key A super key is an attribute or a set of attributes within a table that uniquely identifies… -
What is Cursor? Difference between Implicit and Explicit Cursor
A Cursor is essentially a temporary work area created in the system memory that comes into play during the execution… -
What is Relational Algebra?
Relational algebra is a formal language used to query and manipulate data stored in relational database systems. It provides a… -
What do you mean by Relational Model? Explain with Example
The relational model is a type of model, which represents how the data are stored in a relational database. In… -
Functions of DBA in DBMS
The role of a Database Administrator (DBA) is to manage and maintain the performance, security, and integrity of a database.… -
What is Data Abstraction and Data Redundancy in DBMS
In the world of data management, two terms often come up: data abstraction and data redundancy. Both play crucial roles…