English

In-Order Sliding-Window Aggregation in Worst-Case Constant Time

Databases 2020-09-30 v1 Data Structures and Algorithms

Abstract

Sliding-window aggregation is a widely-used approach for extracting insights from the most recent portion of a data stream. The aggregations of interest can usually be expressed as binary operators that are associative but not necessarily commutative nor invertible. Non-invertible operators, however, are difficult to support efficiently. In a 2017 conference paper, we introduced DABA, the first algorithm for sliding-window aggregation with worst-case constant time. Before DABA, if a window had size nn, the best published algorithms would require O(logn)O(\log n) aggregation steps per window operation---and while for strictly in-order streams, this bound could be improved to O(1)O(1) aggregation steps on average, it was not known how to achieve an O(1)O(1) bound for the worst-case, which is critical for latency-sensitive applications. This article is an extended version of our 2017 paper. Besides describing DABA in more detail, this article introduces a new variant, DABA Lite, which achieves the same time bounds in less memory. Whereas DABA requires space for storing 2n2n partial aggregates, DABA Lite only requires space for n+2n+2 partial aggregates. Our experiments on synthetic and real data support the theoretical findings.

Keywords

Cite

@article{arxiv.2009.13768,
  title  = {In-Order Sliding-Window Aggregation in Worst-Case Constant Time},
  author = {Kanat Tangwongsan and Martin Hirzel and Scott Schneider},
  journal= {arXiv preprint arXiv:2009.13768},
  year   = {2020}
}
R2 v1 2026-06-23T18:52:04.079Z