Timestamp ordering is a unique value given to every transaction whenever it comes into the system to execute.
There are two types of timestamp values
- Read timestamp: It is the value of the last transaction which successfully performed the read operation.
- Write timestamp: It is the value of the last transaction which successfully performed the read operation.
The timestamp value of the transaction that comes later in the system is always greater than the value of the system that comes early in the system. Let a transaction timestamp Ti which newly comes into the system, and then another transaction Tj comes after T1. Then timestamp of Tj is always greater than the timestamp of Tj i.e. TS(Tj)>TS(Ti).
There are two basic algorithms to ensure that the timestamp value is not violated when more than one transaction is executing into the system.
1). Whenever the transaction T issues the Read operation on data (let’s say X) from the database, then
a). If Read_Timestamp(X) > Timestamp(T) then abort T and rollback the operation.
b). Else execute Read(X) operation and set
Read_Timestamp(X) = max{ Read_Timestamp(A), Transtamp(T)}
2). Whenever the transaction T issues the Write operation on data (let’s say X) from the database, then
a). If Read_Timestamp(X) > Timestamp(T) then abort T and rollback.
b). If write_Timestamp(X) > Timestamp(T) then abort T and rollback.
c). Else execute write(X) operation and set
Write_timestamp(X) = Timestamp(T)
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…