next up previous contents index
Next: Significance of Temporal Joins Up: Temporal Join Processing Previous: Temporal Join Processing

Definition and Types of Temporal Joins

    A join condition  is said to be temporal if it enforces a certain relationship between the timestamps  of the participating tuples.  Hence, temporal joins  combine two (or more) temporal relations using a temporal join condition. In terms of interval timestamps , this means that the intervals are related to each other. In chapter 2, we have already seen a typical example of such a temporal join condition, namely the intersection of two intervals as described by equation (2.3).

There are many possible relationships between two intervals: one interval can lie completely before the other, both intervals can start and/or end at the same time, they can overlap each other etc. Temporal joins can be classified according to the type of relationship on which its join condition is based. Table 4.1 shows a set of join conditions. We treat them as elementary for the following three reasons:

An alternative set of elementary interval relationships was presented in [Allen, 1983] for the purpose of natural language processing. It leads, however, to more complex expressions between the start- and endpoints of the intervals that are involved. This makes it more difficult to decompose complex temporal join conditions into elementary ones. For that reason we prefer to use the set presented in table 4.1.


 
Table: Elementary temporal joins and respective conditions for joining tuples $r \in R$ with $q \in Q$.
Relationship Join Name & Symbol Condition Informal Description
start start join: $
\overset 
<3057\gt\gt\mbox{\scriptsize sta}{{\Join}$ r.ts = q.ts same timestamp startpoints
finish finish join: $
\overset 
<3060\gt\gt\mbox{\scriptsize fin}{{\Join}$ r.te = q.te same timestamp endpoints
meet meet join: $
\overset 
<3063\gt\gt\mbox{\scriptsize mt}{{\Join}$ r.te = q.ts timestamp of r ends where timestamp of q starts, i.e. they meet.
before before join: $
\overset 
<3066\gt\gt\mbox{\scriptsize bef}{{\Join}$ r.te < q.ts timestamp of r comes before q's timestamp
left-overlap left-overlap join: $
\overset 
<3069\gt\gt\mbox{\scriptsize lo}{{\Join}$ $r.t_s \gt q.t_s \;\wedge\; r.t_s < q.t_e$ startpoint of r's timestamp lies within q's timestamp
right-overlap right-overlap join: $
\overset 
<3072\gt\gt\mbox{\scriptsize ro}{{\Join}$ $r.t_e \gt q.t_s \;\wedge\; r.t_e < q.t_e$ endpoint of r's timestamp lies within q's timestamp
Additional constraints are: $r.t_s \le r.t_e \;\wedge\; q.t_s \le q.t_e$
                                     


 
Table: Examples of temporal join types that can be derived from the elementary ones.
Join Name 3c|Composition Informal Description    
equal join $R 
\overset 
<3093\gt\gt\mbox{\scriptsize =}{{\Join}Q$ = $R 
\overset 
<3096\gt\gt\mbox{\scriptsize sta}{{\Join}Q \;\cap\; R 
\overset 
<3099\gt\gt\mbox{\scriptsize fin}{{\Join}Q$ same timestamps
after join $R 
\overset 
<3102\gt\gt\mbox{\scriptsize aft}{{\Join}Q$ = $Q 
\overset 
<3105\gt\gt\mbox{\scriptsize bef}{{\Join}R$ timestamp of $r \in R$ is required to lie entirely after the timestamp of a $q \in Q$
overlap join $R 
\overset 
<3108\gt\gt\mbox{\scriptsize olp}{{\Join}Q$ = $R 
\overset 
<3111\gt\gt\mbox{\scriptsize lo}{{\Join}Q \;\cup\; R 
\overset 
<3114\gt\gt\mbox{\scriptsize ro}{{\Join}Q$ timestamps overlap but do not start or finish at the same point
contain join $R 
\overset 
<3117\gt\gt\mbox{\scriptsize con}{{\Join}Q$ = $(R 
\overset 
<3120\gt\gt\mbox{\scriptsize lo}{{\Join}Q \;\cap\; R 
\overset 
<3123\gt\gt\mbox{\scriptsize ro}{{\Join}Q) \;\cup$ timestamp of an $r \in R$
      $(R 
\overset 
<3126\gt\gt\mbox{\scriptsize sta}{{\Join}Q \;\cap\; R 
\overset 
<3129\gt\gt\mbox{\scriptsize ro}{{\Join}Q) \;\cup$ contains the entire
      $(R 
\overset 
<3132\gt\gt\mbox{\scriptsize lo}{{\Join}Q \;\cap\; R 
\overset 
<3135\gt\gt\mbox{\scriptsize fin}{{\Join}Q)$ timestamp of a $q \in Q$
during join $R 
\overset 
<3138\gt\gt\mbox{\scriptsize dur}{{\Join}Q$ = $Q 
\overset 
<3141\gt\gt\mbox{\scriptsize con}{{\Join}R$ timestamp of an $r \in R$ is required to lie entirely within the timestamp of a $q \in Q$
intersection join $R 
\overset 
<3144\gt\gt\mbox{\scriptsize int}{{\Join}Q$ = $R 
\overset 
<3147\gt\gt\mbox{\scriptsize lo}{{\Join}Q \;\cup\; R 
\overset 
<3150\gt\gt\mbox{\scriptsize ro}{{\Join}Q \;\;\cup$ timestamps intersect
      $R 
\overset 
<3153\gt\gt\mbox{\scriptsize sta}{{\Join}Q \;\cup\; R 
\overset 
<3156\gt\gt\mbox{\scriptsize fin}{{\Join}Q \;\cup$  
      $R 
\overset 
<3159\gt\gt\mbox{\scriptsize mt}{{\Join}Q \;\cup\; Q 
\overset 
<3162\gt\gt\mbox{\scriptsize mt}{{\Join}R$  
                                     


The literature has mainly concentrated on the intersection of intervals in the join predicate join. The reason behind this is that it requires the timestamps of the participating tuples to share at least one chronon. This is a minimum constraint that can be found in most other temporal join conditions (see tables 4.1 and 4.2).

Leung and Muntz referred to this minimum constraint as the `TSJ1 query property' [Leung and Muntz, 1992]. Thus intersection join queries are identical with the TSJ1 queries discussed by Leung and Muntz. They show what optimisations (with respect to reducing tuple replication in the case of partitioning over the interval timestamps) can be drawn from specialising the general intersection condition to, for example, a contain or during condition. In these cases, tuple replication can be restricted to some of the participating relations, e.g. to R in a contain join $R 
\overset 
<3183\gt\gt\mbox{\scriptsize con}{{\Join}Q$. However, replication is necessary for at least one of the participating relations in most temporal join conditions if the join is to be processed by partitioning over the interval timestamp attribute [*]. To summarise: whereas Leung and Muntz identify the situations in which tuple replication can be restricted, we will concentrate on how the impact of replication can be reduced when replication is necessary. The latter applies to a wide set of intersection based join conditions. Therefore we will focus on the temporal intersection join as the most general of these joins[*]. However, we stress again that replication is not only relevant for the pure intersection join but it is equally important for many other temporal joins, such as the during, contain, left-overlap, right-overlap and overlap joins. The results that are obtained for the case of the intersection join are therefore easily transferable to these joins.

Usually the tuples that satisfy the join condition are concatenated. In the case of temporal joins this concatenation is not trivial as the value of the timestamp  for the resulting tuple has to be defined. This definition depends on the type of the temporal join; assuming temporal intersection the resulting timestamp is defined to be the intersection of the individual timestamps of the participating tuples. For example in the case of the two tuples r and q the resulting timestamp is  
 \begin{displaymath}[ \max\{r.t_s,q.t_s\}, \min\{r.t_e,q.t_e\} ]
\index{time-concatenation\vert textbf}
\index{concatenation\vert textbf}\end{displaymath} (10)


next up previous contents index
Next: Significance of Temporal Joins Up: Temporal Join Processing Previous: Temporal Join Processing

Thomas Zurek