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
The correctness of (7.13) is trivial: if intervals in R start at time t and intervals in Q start
at t then there are intervals starting at t in
. Similarly for (7.14): if
intervals in
R overlap timepoint t and intervals in Q do the same
then there are overlapping t in
.
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 .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.