An important challenge in modern distributed querying is to efficiently process multiple continuous aggregation queries simultaneously. However, processing each of these queries independently may be prohibitive due to network bandwidth constraints. Multiquery optimizations can be used to share computations across queries in order to reduce the overall network communication. In this paper, we consider this problem in the context of distributed aggregation queries that vary in their selection predicates. We identify settings in which a large set of n such queries can be answered by executing k less than n different queries. The k queries are revealed by analyzing a boolean matrix capturing the connection between data and the queries that they satisfy, in a manner akin to familiar techniques from linear algebra. Indeed, we identify a class of linear aggregate functions (including SUM, COUNT and AVERAGE), and show that the sharing potential for such queries can be optimally recovered using standard matrix decompositions from computational linear algebra. Unfortunately, for some other typical aggregation functions (including MIN and MAX) we find that optimal sharing maps to the NP-hard set basis problem. However, for those scenarios, we present a family of heuristic algorithms that perform well for moderately-sized matrices. We also present an overall distributed system architecture to exploit sharing opportunities, and experimentally evaluate the benefits of our techniques via a novel, flexible random workload generator we develop for this setting.





Download Full History