NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Dynamic Enumeration of Similarity Joins

Pankaj K. Agarwal, Xiao Hu, Stavros Sintos, Jun Yang

TL;DR

This paper introduces dynamic data structures for efficiently enumerating similarity join query results, even when the underlying datasets are constantly changing. They achieve worst-case delay guarantees for reporting pairs of points within a certain distance, a crucial feature for interactive data analysis.

What Problem Does This Paper Address?

Imagine you have two large collections of data points (like customer profiles or sensor readings) and you want to find all pairs that are "similar" to each other, meaning their distance is below a certain threshold. This is a "similarity join" query. In many real-world scenarios, these collections aren't static; points are constantly being added or removed. Traditional methods for similarity joins struggle with these dynamic updates, becoming slow or inaccurate. Furthermore, simply reporting all matching pairs at once can be overwhelming. This paper addresses the challenge of building data structures that can:

  1. Handle dynamic updates: Efficiently insert or delete points from the datasets.
  2. Provide worst-case delay guarantees: Ensure that the time between reporting consecutive similar pairs is bounded, allowing for smooth, interactive exploration of results.
  3. Support various metrics and dimensions: Work with different ways of measuring distance (like L1, L2, or Hamming) and in both low and high-dimensional spaces.

Methods

The paper proposes several data structures tailored to different scenarios:

  • Exact Similarity Joins (Low Dimensions): For L1 and L-infinity metrics, they achieve near-linear space with constant update and delay times. For the L2 metric, they show that achieving constant delay with linear space is not feasible in higher dimensions (d >= 4), and present structures with amortized update and delay times that are sublinear in 'n' but dependent on dimension.
  • Approximate Similarity Joins (Low Dimensions): When the distance threshold can be slightly relaxed (e.g., reporting pairs within 'r' and potentially up to '(1+epsilon)r'), they offer a unified linear-size data structure for L-p metrics with logarithmic delay and update times.
  • High Dimensions (Approximate): For high-dimensional data, they leverage Locality Sensitive Hashing (LSH). LSH is a technique that hashes similar items into the same "buckets" with high probability. Their approach uses LSH to efficiently find candidate pairs and then carefully filters them to ensure bounded delay and avoid reporting too many false positives or duplicates.
  • Triangle Similarity Joins: They extend their methods to handle queries involving three sets of points, looking for triples that are mutually close.

A common theme across their work is the use of geometric data structures like range trees and partition trees, combined with techniques for managing dynamic updates and ensuring bounded output delays.

Datasets

Not discussed in the paper. The paper focuses on theoretical results and data structures rather than empirical evaluation on specific datasets.

Key Insights and Ideas

  • The Trade-off Between Exactness, Dimension, and Delay: The paper clearly demonstrates that achieving constant delay for exact similarity joins becomes significantly harder as the dimension increases, especially for the L2 metric. This motivates the need for approximate solutions.
  • LSH for High Dimensions: Using LSH is a standard technique for similarity search in high dimensions, but the paper's contribution lies in adapting it for dynamic enumeration with worst-case delay guarantees, which requires careful handling of false positives and duplicate reporting.
  • Worst-Case Delay is Key: The emphasis on worst-case delay, rather than just total query time, is crucial for interactive applications. It ensures a predictable user experience, even with challenging data distributions.
  • Reduction Techniques: The paper effectively uses reductions, for example, reducing L1 similarity joins to L-infinity or rectangle containment problems, to leverage existing efficient data structures.

Key Results

The paper presents several theoretical results summarized in Table 1:

  • Exact Similarity Join (L1, L-infinity, fixed r, constant d): O(n) space, O(1) update time, O(1) delay.
  • Exact Similarity Join (L2, fixed r, constant d): O(n) space, O(n^(1-1/d)) amortized update time, O(n^(1-1/d)) delay.
  • Approximate Similarity Join (Lp, variable r, constant d): O(n) space, O(ε⁻ᵈ) update time, O(1) delay.
  • Approximate Similarity Join (L2, fixed r, high dimensions): O(dn + n¹⁺ᵖ) space, O(dn²ᵖ) amortized update time, O(dn²ᵖ) delay, where 'p' depends on the LSH quality.
  • Triangle Similarity Join (Approximate, constant d): O(ε⁻ᵈ n) space, O(ε⁻ᵈ) update time, O(1) delay.

Limitations and Future Work

  • High-Dimensional L2 Exact Join: The paper highlights that achieving constant delay for exact L2 similarity joins in high dimensions (d ≥ 4) with linear space is likely not possible, suggesting a fundamental limitation.
  • Practical Performance: The results are theoretical and focus on worst-case guarantees. The practical performance on real-world "nice" data distributions or specific update sequences is not explored.
  • General Metrics: While the paper discusses Lp and Hamming metrics, extending the techniques to more general metric spaces or complex distance functions (like cosine distance) is suggested as future work.
  • Instance-Dependent Analysis: The authors note that real-world update sequences are often not worst-case, and a more fine-grained, instance-dependent analysis of dynamic enumeration is an interesting open problem.

Summary updated

BibTeX
@inproceedings{agarwal2021dynamic,
  author = {Pankaj K. Agarwal and Xiao Hu and Stavros Sintos and Jun Yang},
  title = {{Dynamic Enumeration of Similarity Joins}},
  booktitle = {ICALP},
  year = {2021},
  doi = {10.4230/lipics.icalp.2021.11},
}
Figure