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

Near-optimal algorithms for shared filter evaluation in data stream systems

Zhen Liu, Srinivasan Parthasarathy, Anand Ranganathan, Hao Yang2008

TL;DR

This paper tackles the challenge of efficiently evaluating multiple overlapping queries on data streams, especially when individual filter evaluations are computationally expensive. The authors introduce two novel algorithms, a Greedy approach and a Harmonic approach, that offer near-optimal performance guarantees, significantly improving upon prior work and demonstrating superior practical performance in multimedia stream analysis.

What Problem Does This Paper Address?

Imagine a system that continuously receives data (like images or videos) and needs to check if each incoming item matches a set of user-defined queries. These queries are often complex, formed by combining multiple "filters" (e.g., "does this image contain water?", "is the sky blue?"). The real challenge arises when:

  1. Filters are expensive: Evaluating a single filter can take hundreds of milliseconds, making a naive approach of checking every filter for every query prohibitively slow.
  2. Queries overlap: Many queries might share common filters. Simply re-evaluating these shared filters for each query is wasteful.
  3. Queries are adaptive: The decision of which filter to evaluate next can depend on the results of previous filter evaluations.

This problem, known as "shared filter ordering," is computationally hard (NP-Hard) and even difficult to approximate. The paper aims to find efficient algorithms that can determine the optimal order to evaluate filters for each incoming data item to minimize the total evaluation cost, while ensuring all relevant queries are correctly identified.

Methods

The paper introduces two main algorithmic contributions:

  • Edge-Coverage Based Greedy Algorithm: This algorithm views the problem as covering "edges" in a bipartite graph representing the relationships between filters and queries. At each step, it greedily selects the filter that offers the "best bang for its buck" – balancing its cost against the expected number of filter-query relationships it can resolve. This approach achieves a near-optimal approximation ratio of $(1 + \log(n) + \log(\alpha))$, where $n$ is the number of queries and $\alpha$ is the average number of filters per query. This is a significant theoretical improvement over previous methods.
  • Randomized Harmonic Algorithm: This algorithm offers a faster, parallelizable approach. It selects filters based on a probabilistic strategy related to their costs and selectivities, aiming to cover query-filter relationships. It achieves an approximation ratio of $2^\beta$, where $\beta$ is the maximum number of filters in any single query. While the theoretical guarantee is not as strong as the Greedy algorithm for all cases, its speed and parallelizability make it attractive.

Both algorithms are designed to work with the concept of a "residual graph," which dynamically represents the remaining filters to be evaluated and queries yet to be decided.

Datasets

The experiments were conducted using:

  • IMARS (Multimedia Analysis and Retrieval System) filters: A set of 190 pre-trained semantic filters for image analysis.
  • Flickr dataset: 20,000 images crawled from Flickr, used as the stream data.

No new benchmarks were introduced; the focus was on evaluating the proposed algorithms on a realistic multimedia stream analysis scenario.

Key Insights and Ideas

  • Reframing the Problem: The core insight is shifting the perspective from "covering queries" to "covering the connections (edges) between filters and queries." This subtle change in viewpoint unlocks significantly better approximation guarantees.
  • Cost-Benefit Analysis for Filters: The Greedy algorithm's success hinges on its sophisticated "unit-price" calculation, which balances filter cost, selectivity, and popularity to make informed decisions.
  • Trade-off between Theory and Practice: The Harmonic algorithm highlights a practical trade-off: while its theoretical guarantees might be slightly weaker in some aspects, its speed and parallelizability make it a strong contender for real-world, high-throughput systems.
  • Importance of Filter Sharing: The experiments strongly suggest that the degree of filter sharing across queries is a critical factor influencing performance, and algorithms that effectively leverage this sharing (like the proposed Greedy algorithm) yield substantial benefits.

Key Results

  • Greedy Algorithm Superiority: The proposed Edge-Coverage Greedy algorithm consistently outperformed both the Harmonic algorithm and a prior S-Greedy algorithm (from Munagala et al.) in terms of evaluation time across various experimental settings.
  • Significant Speedup: In one experiment with 2,000 queries and 190 filters, the Greedy algorithm reduced evaluation time by 16.9% compared to S-Greedy and 49.2% compared to Harmonic.
  • Scalability: Both Greedy and S-Greedy showed better performance scaling than Harmonic as the number of queries and filters increased.
  • Harmonic Algorithm Efficiency: Despite not always achieving the best evaluation time, the Harmonic algorithm demonstrated significantly faster runtime efficiency, making it suitable for scenarios where the evaluation engine itself is a bottleneck.
  • Impact of Filter Popularity: The performance of all algorithms benefits from increased filter sharing, which is more pronounced with skewed popularity distributions (like Zipf).

Limitations and Future Work

  • Independence Assumption: The theoretical analysis of the Greedy algorithm assumes filter selectivities are independent. The authors note that their algorithms can be generalized to correlated filters, but the analysis becomes more complex.
  • Future Work: The authors suggest exploring more rigorous analysis for correlated filter selectivities and designing efficient algorithms for this more general setting, which they acknowledge is very challenging. They also mention the potential for parallelizing their algorithms in a multi-server environment.

Summary updated

BibTeX
@misc{liu2008near,
  author = {Zhen Liu and Srinivasan Parthasarathy and Anand Ranganathan and Hao Yang},
  title = {{Near-optimal algorithms for shared filter evaluation in data stream systems}},
  year = {2008},
  doi = {10.1145/1376616.1376633},
}
Figure