Tuple-versioning (also called point-in-time) is a mechanism used in a
relational database management system
A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relati ...
to store past states of a
relation. Normally, only the current state is captured.
Using tuple-versioning techniques, typically two values for time are stored along with each
tuple
In mathematics, a tuple is a finite ordered list (sequence) of elements. An -tuple is a sequence (or ordered list) of elements, where is a non-negative integer. There is only one 0-tuple, referred to as ''the empty tuple''. An -tuple is defi ...
: a start time and an end time. These two values indicate the validity of the rest of the values in the tuple.
Typically when tuple-versioning techniques are used, the current tuple has a valid start time, but a
null value for end time. Therefore, it is easy and efficient to obtain the current values for all tuples by
querying for the null end time.
A single query that searches for tuples with start time less than, and end time greater than, a given time (where null end time is treated as a value greater than the given time) will give as a result the valid tuples at the given time.
For example, if a person's job changes from Engineer to Manager, there would be two tuples in an Employee
table
Table may refer to:
* Table (furniture), a piece of furniture with a flat surface and one or more legs
* Table (landform), a flat area of land
* Table (information), a data arrangement with rows and columns
* Table (database), how the table data ...
, one with the value Engineer for job and the other with the value Manager for job. The end time for the Engineer tuple would be equal to the start time for the Manager tuple.
The pattern known as
log trigger uses this technique to automatically store historical information of a
table
Table may refer to:
* Table (furniture), a piece of furniture with a flat surface and one or more legs
* Table (landform), a flat area of land
* Table (information), a data arrangement with rows and columns
* Table (database), how the table data ...
in a
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases spa ...
.
See also
*
Temporal database
*
Bitemporal data
A temporal database stores data relating to time instances. It offers temporal data types and stores information relating to past, present and future time.
Temporal databases could be uni-temporal, bi-temporal or tri-temporal.
More specifically th ...
*
Log trigger
References
Comparison of Access Methods for Time-Evolving Data by Betty Salzberg and Vassilis J. Tsotras,
ACM
ACM or A.C.M. may refer to:
Aviation
* AGM-129 ACM, 1990–2012 USAF cruise missile
* Air chief marshal
* Air combat manoeuvring or dogfighting
* Air cycle machine
* Arica Airport (Colombia) (IATA: ACM), in Arica, Amazonas, Colombia
Computing
* ...
Computing Surveys, Vol. 31, No. 2, June 1999.
Data modeling
{{comp-stub