Databases Reference
In-Depth Information
Point in Time to Period of Time Queries
A point in time is a period of time that includes only one
clock tick. Thus, using the closed-open convention, a point in
time, T 1 , is identical to the period of time [T 1 -T 2 ] where T 2 is
the next clock tick after T 1 . The only difference is in the notation.
In the following discussions, we will use the simpler notation,
T 1 , for the point in time.
In this section, we consider periods of time that are longer
than a single clock tick. Periods of time that are one clock tick
in length are points in time, and we consider Allen relationships
between two points in time later.
Given that P 1 is longer than a single clock tick, it may or may
not share a clock tick with T 1 . If it does, then T 1 [ occupies ] P 1 .
Otherwise, either one is [before] the other, or else they [meet].
In Asserted Versioning databases, all temporal periods are
delimited with the same point in time granularities. When compar-
ing time periods to time periods, the logic in the AVF does not
depend on the granularity of the clock ticks used in temporal
parameters, as long as all of them are the same. The clock ticks
couldbemonths (as they are in the examples throughout this topic),
days, seconds ormicroseconds of any size. Aswenoted inChapter 3,
the AVF can carry out its temporal logic without caring about
granularity specifically because of the closed-open convention.
However, when comparing a point in time to a period of time,
we must be aware of the granularity of the clock tick, and must
often either add a clock tick to a point or period in time, or sub-
tract a clock tick from a point or period in time. Consequently,
we need to specify the clock tick duration used in the specific
implementation to correctly perform this arithmetic. We will
use “fCTD”, standing for “clock tick duration”, as the name of a
function that converts an integer into that integer number of
clock ticks of the correct granularity. So, for example, in:
eff_end_dt - f CTD(1)
fCTD takes on the value of one clock tick. If the granularity is a
month, as it is in most of the examples in this topic, the result will
be to subtract one month from the effective end date. If the gran-
ularity is a millisecond-level timestamp, it will subtract one milli-
second from that date. The fCTD function determines the
granularity for a specific Asserted Versioning database from the
miscellaneous metadata table, shown as Figure 8.7 in Chapter 8.
Different DBMSs use different date formats for date literals.
It is also dependent on the default language and the date format
currently set. These formats are shown in Figure 14.14 .
 
Search WWH ::




Custom Search