Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Temporal database
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Using two axes: valid time and transaction time=== {{Main article|Transaction time}} [[Transaction time]] records the time period during which a database entry is accepted as correct. This enables queries that show the state of the database at a given time. Transaction time periods can only occur in the past or up to the current time. In a transaction time table, records are never deleted. Only new records can be inserted, and existing ones updated by setting their transaction end time to show that they are no longer current. To enable transaction time in the example above, two more fields are added to the Person table: <code>transaction_from</code> and <code>transaction_to</code>. Here, <code>transaction_from</code> is the time a transaction was made, and <code>transaction_to</code> is the time that the transaction was superseded (which may be infinity if it has not yet been superseded). This makes the table into a [[#Bitemporal_relations|bitemporal table]]. What happens if the person's address as stored in the database is incorrect? Suppose an official accidentally entered the wrong address or date? Or, suppose the person lied about their address for some reason. Upon discovery of the error, the officials update the database to correct the information recorded. For example, from 1995-06-01 to 2000-09-03, John Doe moved to Beachy. But to avoid paying Beachy's exorbitant residence tax, he never reported it to the authorities. Later during a tax investigation, it is discovered on 2-Feb-2001 that he was in fact in Beachy during those dates. To record this fact, the existing entry about John living in Bigtown must be split into two separate records, and a new record inserted recording his residence in Beachy. The database would then appear as follows: {| class="wikitable" !Name !City !Valid from !Valid to |- |John Doe |Smallville |1975-04-03 |1994-08-26 |- |John Doe |Bigtown |1994-08-26 |1995-06-01 |- |John Doe |Beachy |1995-06-01 |2000-09-03 |- |John Doe |Bigtown |2000-09-03 |2001-04-01 |} However, this leaves no record that the database ever claimed that he lived in Bigtown during 1995-06-01 to 2000-09-03.This might be important to know for auditing reasons, or to use as evidence in the official's tax investigation. Transaction time allows capturing this changing knowledge in the database, since entries are never directly modified or deleted. Instead, each entry records when it was entered and when it was superseded (or logically deleted). The database contents then look like this: {| class="wikitable" !Name !City !Valid from !Valid to !Entered !Superseded |- |John Doe |Smallville |1975-04-03 |β |1975-04-04 |1994-12-27 |- |John Doe |Smallville |1975-04-03 |1994-08-26 |1994-12-27 |β |- |John Doe |Bigtown |1994-08-26 |β |1994-12-27 |2001-02-02 |- |John Doe |Bigtown |1994-08-26 |1995-06-01 |2001-02-02 |β |- |John Doe |Beachy |1995-06-01 |2000-09-03 |2001-02-02 |β |- |John Doe |Bigtown |2000-09-03 |β |2001-02-02 |2001-04-01 |- |John Doe |Bigtown |2000-09-03 |2001-04-01 |2001-04-01 |β |} The database records not only what happened in the real world, but also what was officially recorded at different times.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)