Managing Intervals Efficiently in Object-Relational Databases

Hans-Peter Kriegel, Marco Pötke, Thomas Seidl

The Relational Interval Tree (RI-tree) represents a significant advancement in how modern Object-Relational Database Management Systems (ORDBMS) handle interval data. Presented at VLDB 2000, this approach bridges the gap between specialized, high-performance interval structures and the practical constraints of industrial-strength relational engines.

The Challenge of Interval Data

Standard relational databases are built around the "point" data model, where each attribute represents a single value. B+-trees, the workhorse of SQL indexing, excel at range queries on these points. However, many real-world applications—ranging from temporal versioning to spatial GIS data—require managing intervals $[lower, upper]$.

Finding all intervals that overlap a query range $[q_{lower}, q_{upper}]$ is computationally expensive for standard indexes. While specialized structures like Segment Trees or Edelsbrunner’s Interval Trees offer logarithmic performance, they typically require modifying the database kernel to support new index types. Such modifications are often resisted by database vendors due to the complexity of integrating new structures with existing transaction, recovery, and optimization subsystems.

The RI-tree: A Relational Approach

The RI-tree solves this by mapping the logic of an interval tree onto standard relational tables and B+-tree indexes. It follows the "As-They-Are" paradigm, utilizing existing database features to achieve specialized performance.

The Virtual Backbone and Fork Nodes

At the heart of the RI-tree is a "virtual" balanced binary search tree that partitions the data space. Unlike a physical index, this backbone is never stored. Instead, it serves as a logical framework to categorize intervals.

Every interval $[lower, upper]$ is assigned to a specific node in this virtual tree called the fork node. The fork node is the highest node in the tree that is contained within the interval. Mathematically, it is the node where the search paths for $lower$ and $upper$ diverge.

Algorithm for calculating the fork node of an interval.

Storage and Indexing

Once the fork node is determined, the interval is stored in a relational table with its node ID. To optimize queries, two composite B+-tree indexes are maintained:

  1. lowerIndex: Indexed on (node, lower)
  2. upperIndex: Indexed on (node, upper)

This structure ensures that all intervals assigned to the same node are clustered together, allowing for efficient range scans.

Query Processing

To find intervals overlapping a query range $[q_{lower}, q_{upper}]$, the RI-tree traverses the virtual backbone. The query logic identifies three sets of nodes: those on the path from the root to $q_{lower}$, those on the path to $q_{upper}$, and those between these two paths. For each visited node, the system performs a highly selective range scan on either the lowerIndex or upperIndex depending on the node's position relative to the query range.

Visualization of the query process identifying nodes for scanning.

The query is executed as a single SQL statement using UNION ALL. Because the logic ensures that each interval is reported by exactly one node scan, there is no need for expensive duplicate elimination (DISTINCT), further boosting performance.

Performance Evaluation

The authors tested the RI-tree against established methods like Oracle’s Tile Index and Interval-Spatial Transformation (IST) using synthetic datasets of up to one million intervals. The results were compelling:

  • Efficiency: The RI-tree achieved up to a 42x reduction in disk I/O compared to the Tile Index.
  • Speed: Query response times were up to 4.9x faster than competing relational methods.
  • Scalability: Performance scaled sub-linearly with the number of records, a critical requirement for large-scale production databases.

Conclusion

The RI-tree demonstrates that specialized data structures can be effectively "virtualized" within a relational framework. By leveraging standard B+-trees, it provides the performance of an interval tree while maintaining the robustness and ease of deployment of a standard SQL database. This approach remains a benchmark for implementing complex data types in object-relational systems.

Summary updated

BibTeX
@inproceedings{kriegel2000managing,
  author = {Hans-Peter Kriegel and Marco Pötke and Thomas Seidl},
  title = {{Managing Intervals Efficiently in Object-Relational Databases}},
  booktitle = {VLDB},
  year = {2000},
}
Figure