next up previous contents index
Next: Merging Incomplete IP-Tables Up: Merging IP-Tables Previous: Merging IP-Tables

Merging Complete IP-Tables

  

The basic merging process is fairly straightforward: Imagine two complete IP-tables I(R) and I(Q) of two relations R and Q participating in a temporal join . They have timepoint sets V(R) and V(Q) and functions and respectively. These two tables can be merged into one IP-table   with timepoint set

and functions , defined as

We note that the IP-table of R might not hold values for all and, similarly, the IP-table of Q might not for all . This is not actually a problem as the missing values can be derived by using the third observation made in section 7.1: it is

for all and in particular for those in the case that the IP-tables are merged. The same applies vice versa when values for and have to be derived.

The correctness of (7.13) is trivial: if $s_{\scriptscriptstyle R}(t)$intervals in R start at time t and intervals in Q start at t then there are intervals starting at t in $R \cup Q$. Similarly for (7.14): if $o_{\scriptscriptstyle R}(t)$ intervals in R overlap timepoint t and intervals in Q do the same then there are overlapping t in $R \cup Q$.

Figure 7.17 shows the algorithm that merges two complete IP-tables I(R) and I(Q) into one IP-table that describes the characteristics of the intervals in $R \cup Q$.The timepoint sets

are merged into the set

The values , , are stored in arrays , , respectively (;; ). Similarly, ,, are respectively stored in the arrays , , . The algorithm mainly consists of a while-loop that merges the timepoints of V(R) and V(Q) and calculates their values and according to (7.13) and (7.14). This while-loop stops when all of the timepoints of at least one of these sets has been merged into . Then there might be timepoints that have not been processed yet. This is done by one of the following two while-loops. Finally, the cardinality N of is set.


  
Figure: The merge algorithm for two complete IP-tables.


next up previous contents index
Next: Merging Incomplete IP-Tables Up: Merging IP-Tables Previous: Merging IP-Tables

Thomas Zurek