ArticleslgStudy

computer science

Valid time

Valid time is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Valid time rather than just read about it. In short: In temporal databases, valid-time is the time period when an event happened or something was true in the real world, or more formally when a fact was valid in the modeled reality. The valid-time period is an interval based on event times, which are referred to as event datetime in data vault.

Key takeaways

  • Valid time belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Valid time to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Valid time from memory before moving on to harder problems.

Reference excerpt

In temporal databases, valid-time is the time period when an event happened or something was true in the real world, or more formally when a fact was valid in the modeled reality. The valid-time period is an interval based on event times, which are referred to as event datetime in data vault. Other names are application-time period or real-world timeline. SQL:2011 supports valid time through so-called application time-period tables. In a database table, valid-time is often represented by two extra table-columns, such as start_validtime and end_validtime. The time interval is closed at its lower bound (denoted by [) and open at its upper bound (denoted by )). In integration layers (for example a data warehouse), the valid time is controlled by the source system which delivers data to the data warehouse. For many reasons, the valid timeline is different from the transaction timeline (which is when data arrives in the warehouse), and it is important that the data warehouse is capable of unambiguously reporting what actually happened in the past by combining these two timelines. In bitemporal data models, valid time and transaction time can be represented two-dimensionally in a Cartesian coordinate system. When data are delivered from the integration layer and is to be represented in a presentation layer (often in a dimensional model or wide table) it is often desirable to have the data on only one timeline.

History The term valid time was coined by Richard T. Snodgrass and his doctoral student Ilsoo Ahn (1986). As of December 2011, ISO/IEC 9075, Database Language SQL:2011 Part 2: SQL/Foundation included clauses in table definitions to define "application-time period tables" (that is, valid-time tables).

Example

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 1975-04-04, 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 another place so in the database the valid_to is filled with infinity (∞) or a very late date (like for example 2300-01-01). Resulting in this entry in the database:

On 1994-12-27 John reports his new address in Bigtown where he has been living since 1994-08-26. The Bigtown official does not change the address of the current entry of John Doe in the database. He adds a new one:

The original entry Person (John Doe, Smallville, 1975-04-03, ∞) is then updated (not removed!). Since it is now known that John stopped living in Smallville on 1994-08-26, the valid_to entry can be filled in. The database now contains two entries for John Doe

When John dies the database is once more updated. The current entry will be updated stating the date of death as the last valid_to for Bigtown, as John does not live in Bigtown any longer. No new entry is being added. The database now looks like this:

See also Transaction time, when data was loaded into a database Decision time, when a decision was made about interpretation of history in a database Slowly changing dimension

References

Worked examples

Example 1 — a first encounter with Valid time

Start with the simplest possible case. Write down what Valid time claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Valid time before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Valid time ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Valid time

In research
Valid time appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Valid time in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Valid time is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer programming stubs, Database management systems, so understanding it makes those chapters shorter.
In everyday life
Look for Valid time outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Valid time” →

How to study Valid time in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Valid time means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Valid time out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Valid time in simple terms?

In temporal databases, valid-time is the time period when an event happened or something was true in the real world, or more formally when a fact was valid in the modeled reality. The valid-time period is an interval based on event times, which are referred to as event datetime in data vault.

Why does Valid time matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Valid time?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Valid time.

Tags

  • Computer programming stubs
  • Database management systems

Keep exploring