Valid time
Encyclopedia
Valid time a concept originated by Richard T. Snodgrass
Richard T. Snodgrass
Richard Thomas Snodgrass is an American computer scientist and writer, currently employed as a professor at the University of Arizona. He is best known for his work on temporal databases, query language design, query optimization and evaluation, storage structures, database design, and ergalics...

 and his doctoral student, is used in temporal database
Temporal database
A temporal database is a database with built-in time aspects, for example a temporal data model and a temporal version of Structured Query Language.More specifically the temporal aspects usually include valid-time and transaction-time...

s.
It denotes the time period during which a database fact was, is, or will be valid in the modeled reality.

In a database table valid time is often represented by two extra table-columns StartVT and EndVT. The time interval is closed at its lower bound and open at its upper bound
Upper bound
In mathematics, especially in order theory, an upper bound of a subset S of some partially ordered set is an element of P which is greater than or equal to every element of S. The term lower bound is defined dually as an element of P which is lesser than or equal to every element of S...

.
Example:
Date What happened in the real world Database Action What the database shows
April 3, 1975 John is born Nothing There is no person called John Doe
April 4, 1975 John's father officially reports John's birth Inserted:Person(John Doe, Smallville) John Doe lives in Smallville
August 26, 1994 After graduation, John moves to Bigtown, but forgets to register his new address Nothing John Doe lives in Smallville
December 26, 1994 Nothing Nothing John Doe lives in Smallville
December 27, 1994 John registers his new address Updated:Person(John Doe, Bigtown) John Doe lives in Bigtown
April 1, 2001 John dies Deleted:Person(John Doe) There is no person called John Doe


Valid time is the time for which a fact is true in the real world. In the example above, the Person table gets two extra fields, Valid-From and Valid-To, specifying when a person's address was valid in the real world. On April 4, 1975 John's father proudly registered his son's birth. An official will then insert a new entry to the database stating that John lives in Smallville from April, 3rd. Notice that although the data was inserted on the 4th, the database states that the information is valid since the 3rd. The official does not yet know if or when John will ever move to a better place so in the database the Valid-To is filled with infinity (∞). Resulting in this entry in the database:
Person(John Doe, Smallville, 3-Apr-1975, ∞).

December 27, 1994 John reports his new address in Bigtown where he has been living since August 26, 1994. The Bigtown official does not change the address of the current entry of John Doe in the database. He adds a new one:
Person (John Doe, Big Town, 26-Aug-1994, ∞).

The original entry Person (John Doe, Smallville, 3-Apr-1975, ∞) is then updated (not removed!). Since it is now known that John stopped living in Smallville on August 26, 1994 the Valid-To entry can be filled in. The database now contains two entries for John Doe
Person(John Doe, Smallville, 3-Apr-1975, 26-Aug-1994).
Person(John Doe, Bigtown, 26-Aug-1994, ∞).

When John dies the database is once more updated. The current entry will be updated stating that John does not live in the Bigtown any longer. No new entry is being added because officials never report heaven as a new address. The database now looks like this
Person(John Doe, Smallville, 3-Apr-1975, 26-Aug-1994).
Person(John Doe, Bigtown, 26-Aug-1994, 1-Apr-2001).
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK