Glossary
As-of query
An as-of query retrieves a record relative to a specified point in its time model.
Time and versioning
An as-of query asks for a record at a specified time rather than simply returning its latest state. The question is incomplete unless it says which clock it uses. A valid-time query asks what applied on the target date according to a chosen knowledge state. A transaction-time query asks what the system held at the target date. A bitemporal query can state both dates and expose the difference.
In practice, the query contract should define time zone, precision, interval boundaries, and how open or unknown dates behave. A replay must include the relevant identity links, classifications, and source versions, not only one field's old value. A change to an interpretation rule can also alter a historical answer unless the rule version is retained. The output should show the two temporal coordinates when they matter to the reader.
Organizations use as-of queries to examine what supported a past decision or to reassess an earlier date under today's evidence. Those are distinct exercises with different answers, both potentially legitimate. Naming the time axis prevents a retrospective correction from masquerading as contemporaneous knowledge. The query is a retrieval operation; point-in-time reproducibility is the broader ability to recreate the entire decision context and explain its inputs.
Example
For Halden Therapeutics AG (fictional), a 10 May as-of query can ask what was recorded on 10 May or what is now known to have applied on 10 May.
The forms an as-of query can take
An as-of query names a point in time and asks for the state of the data at that point. Which time it names matters. A valid-time as-of query asks what was true in the world on that date according to what the system now knows. A transaction-time as-of query asks what the system itself recorded on that date, regardless of later corrections. A bitemporal query fixes both: what the system recorded on one date about the world on another. Martin Fowler's bitemporal history illustrates the three with a worked example. In SQL products with system versioning the transaction-time form is written as a clause on the table, as described in the Microsoft documentation of temporal tables, and the lakehouse formats expose snapshots by timestamp or version.
The same idea exists on the web. The Memento protocol, RFC 7089, lets a client request a resource as it existed at a given date, and web archives such as the Wayback Machine provide it for public pages.
Making the answer trustworthy
An as-of answer is only as good as the history behind it. Check three things. First, coverage: the store must have been recording at the date asked about, and a query for a date before the system began should return a clear statement of that, not an empty result that looks like absence of facts, a case of the closed-world mistake. Second, resolution: if changes were batched, the answer is correct only at batch boundaries. Third, inputs: if the answer depends on retained sources, those sources must also be retrievable as of the date, which links the query to retained source copies.
As-of queries are also a testing tool. Replaying a decision with the data as of the decision date tests whether the stored inputs were sufficient to reproduce it. The article on temporal knowledge graph benchmark leakage shows the converse problem: evaluating a model with data that were not available at the time of the prediction, which as-of discipline prevents.
A worked example
A procurement team asks which suppliers were approved for use on 30 September, as the board saw them. The straightforward query against current data returns the list as it now stands, including one supplier whose approval was backdated in November and one that was removed in October. A transaction-time as-of query for 30 September returns the list the system showed then, without the November backdating, which is what the board saw. A bitemporal query for validity on 30 September as known on 31 December returns the corrected position, including the backdated approval. Both answers are right for different questions, and the report states which question it answers.
Checks a reviewer can run
Run an as-of query for a date before and after a known correction and compare the answers. State which time axis the query uses. Query a date before the system started and check the response. Confirm that results carry the as-of parameters in their output, so that a printed report shows the date it describes. Confirm that the sources behind an old answer are still retrievable.
Related terms and boundaries
As-of queries depend on bitemporal data or on transaction time alone, use valid time when the world's dates matter, and are the practical basis of point-in-time reproducibility. They rely on an append-only log or event sourcing for history.
Common misreadings
- Using 'as of' without naming valid or transaction time.
- Replaying values while silently using current identity links or rules.
- Dropping unknown temporal bounds from results.
Appears in
- Data warehouse vs system of record
A warehouse organizes data for analysis; a system of record governs the accepted state used for a defined decision.
- Retrieval-augmented generation vs a system of record
Retrieval supplies context for an answer; a system of record governs which values may be treated as settled.
- Snapshots vs bitemporal history
Snapshots preserve states at selected moments; bitemporal history distinguishes when a fact applied from when it was recorded.
- Reproducing a past state
Reconstruct what was known at a specified instant using observation time, effective time and earlier decisions.
- Scoping a first record
Start with one contested entity and a bounded decision, then test whether its evidence can be defended.
References
- Snodgrass, Developing Time-Oriented Database Applications in SQL (1999).
- Fowler, Bitemporal History.
- Microsoft Learn, Temporal tables (SQL Server).
- Apache Iceberg documentation, Queries (time travel).
- IETF (2013), RFC 7089: HTTP Framework for Time-Based Access to Resource States (Memento).
- Internet Archive, Using the Wayback Machine.
Found an error on this page? See corrections for what counts as one, how to report it and the dated log.
Enquiry
Where does "As-of query" bear on a decision of yours?
This entry sits under time and versioning. If a decision in your organization turns on it, send the entity concerned, the sources you fuse to describe it and who may read which of them. We reply with what a first record would cover.
Or write to [email protected] in your own words.