CPC G06F 16/2477 (2019.01) [G06F 16/2282 (2019.01); G06F 16/288 (2019.01); G06F 16/9024 (2019.01); G06F 30/20 (2020.01)] | 15 Claims |
1. A system for bi-temporal data retrieval, the system comprising:
a processor; and
a non-transitory computer-readable storage medium containing computer program code for execution by the processor and causing the processor to:
receive a query for a value of a key at a subject time with respect to an observation time, the query specifying at least the subject time and the observation time;
identify a data structure associated with the key in the data store, the data structure having a set of validity-recordation time pairs grouped into a plurality of recorded validity times, each validity-recordation time being associated with a stored value;
traverse the data structure backwards in reverse chronological order first by validity time and second by recordation time by:
identifying a first recorded validity time, of the plurality of recorded validity times, before and closest to the subject time;
determining that no validity-recordation time pairs having the first recorded validity time have a recordation time before the observation time;
responsive to the determination, identifying a second recorded validity time, of the plurality of recorded validity times, before the first recorded validity time; and
identifying a validity-recordation time pair having a validity time matching the second recorded validity time and a recordation time before and closest to the observation time;
retrieve the stored value associated with the identified validity-recordation time pair as a response to the query; and
return the retrieved value in response to the query.
|