SWOOP: Top-k Similarity Joins over Set Streams

Willi Mann, Nikolaus Augsten, Christian S. Jensen

Abstract

In high-velocity data environments, identifying the most similar pairs of items within a sliding temporal window is a critical yet computationally expensive task. This paper presents SWOOP, a scalable algorithm designed for top-$k$ similarity joins over set streams. SWOOP leverages a novel candidate index and an incremental maintenance strategy for a minimal "stock" of potential results. Experimental results demonstrate that SWOOP outperforms existing state-of-the-art methods by up to three orders of magnitude, maintaining high throughput and low latency even as window sizes increase.

Introduction

Modern data streams—ranging from social media feeds to transaction logs—generate massive volumes of information that require real-time analysis. A common requirement is the Top-k Similarity Join: finding the $k$ most similar pairs of items (e.g., tweets, documents) within a recent sliding window of time.

Executing these joins on high-speed streams presents two primary challenges:

  1. Candidate Generation: Comparing every new arrival against all existing items in the window is computationally prohibitive.
  2. Result Expiration: As items age and exit the sliding window, any top-$k$ pairs they belonged to must be replaced. This necessitates maintaining a "stock" of backup pairs that could potentially enter the top-$k$ set in the future.

Existing solutions often struggle with the throughput requirements of real-world streams or rely on costly full recomputations when the window shifts.

The SWOOP Framework

SWOOP addresses these challenges through a streamlined framework that manages both the active window and the result stock incrementally.

The SWOOP Stream Join Framework, illustrating the interaction between the incoming stream, the sliding window $W$, and the result stock $S$.

As shown in Figure 1, the framework follows a five-step process for each new arrival $r_i$:

  1. Index Time Update: Synchronizing the internal clock $t_J$.
  2. Stock Cleanup: Removing expired pairs from the stock $S$ whose end-times have passed.
  3. Window Cleanup: Removing expired items from the window $W$.
  4. Candidate Generation: Identifying new potential top-$k$ pairs involving $r_i$ and adding them to the stock.
  5. Window Update: Adding the new item $r_i$ to the window.

Key Optimizations

The efficiency of SWOOP stems from several algorithmic innovations:

1. Optimized Candidate Indexing

Instead of exhaustive search, SWOOP utilizes an inverted index mapping tokens to the sets containing them. This index is optimized for streaming, allowing for rapid insertion and expiration.

Detailed view of the candidate generation process using an inverted index $I$ to identify potential matches for a new insertion.

2. Pruning with Positional Upper Bounds

During index traversal, SWOOP calculates positional upper bounds on similarity. If the maximum possible similarity for a candidate (based on its remaining tokens) falls below the current top-$k$ threshold, the search for that candidate is pruned immediately.

3. Skyband Lower Bound

SWOOP employs a "skyband" concept to maintain a provably minimal stock. It calculates a mathematical "floor"—the minimum similarity a pair needs to potentially enter the top-$k$ before it expires. Pairs falling below this threshold are discarded, significantly reducing memory overhead.

4. Incremental Stock Maintenance

Unlike previous methods that recompute potential results from scratch, SWOOP updates its result stock incrementally in logarithmic time. This ensures the system can keep pace with the "firehose" of incoming data without falling behind.

Experimental Evaluation

The researchers evaluated SWOOP against five diverse real-world datasets: TWEET (geocoded tweets), DBLP (scientific metadata), FLICKR (photo tags), ENRON (emails), and INDUSTRY (workflow logs).

Key findings include:

  • Performance: SWOOP outperformed the previous state-of-the-art (SCase) by two to three orders of magnitude in terms of processing rate.
  • Scalability: SWOOP's performance remained stable even as the sliding window size increased, whereas competing algorithms saw significant performance degradation.
  • Real-time Viability: On the TWEET dataset, SWOOP processed tens of thousands of sets per second with a maximum latency of 0.03 seconds.

Conclusion

SWOOP represents a significant advancement in streaming similarity joins. By combining efficient indexing, aggressive pruning, and incremental maintenance, it enables real-time top-$k$ monitoring on high-speed data streams. Future work may explore extending these optimizations to asymmetric joins between two different streams and leveraging hardware acceleration like GPUs to further enhance throughput.

Summary updated

BibTeX
@article{mann2025swoop,
  author = {Willi Mann and Nikolaus Augsten and Christian S. Jensen},
  title = {{SWOOP: Top-k Similarity Joins over Set Streams}},
  journal = {VLDB J.},
  year = {2025},
  doi = {10.1007/s00778-024-00880-x},
}
Figure