因子窗口:基于代价的查询重写优化相关窗口聚集
Factor Windows: Cost-based Query Rewriting for Optimizing Correlated Window Aggregates
摘要:
窗口聚集在流处理中是普遍存在的。在Azure流分析(ASA)中,由微软的Azure云托管的流处理服务,我们看到许多客户查询包含多个相关窗口上的聚合函数(例如MIN和MAX)(例如,长度为五分钟和十分钟的翻转窗口)。在本文中,我们提出了一个基于成本的优化框架,通过在多个窗口之间共享计算来优化此类查询。特别是,我们引入了因子窗口的概念,这是辅助窗口,不是在输入查询,但可能有助于降低整体计算成本,我们的成本为基础的优化器可以产生重写的查询计划,具有较低的成本比原来的查询计划,利用因子窗口。由于我们的优化技术是在查询(计划)重写的水平,他们可以实现任何流处理系统,支持声明性的,SQL类查询语言,而不改变底层的查询执行引擎。我们正式的共享计算问题,提出了详细的优化技术,并报告在合成和真实数据集的评估结果。我们的研究结果表明,与原始的查询计划相比,我们基于成本的优化器输出的重写计划可以产生更高的吞吐量(高达16.8倍)。
英文摘要:
Window aggregates are ubiquitous in stream processing. In Azure Stream Analytics (ASA), a stream processing service hosted by Microsoft's Azure cloud, we see many customer queries that contain aggregate functions (such as MIN and MAX) over multiple correlated windows (e.g., tumbling windows of length five minutes and ten minutes) defined on the same event stream. In this paper, we present a cost-based optimization framework for optimizing such queries by sharing computation among multiple windows. In particular, we introduce the notion of factor windows, which are auxiliary windows that are not in the input query but may nevertheless help reduce the overall computation cost, and our cost-based optimizer can produce rewritten query plans that have lower costs than the original query plan by utilizing factor windows. Since our optimization techniques are at the level of query (plan) rewriting, they can be implemented on any stream processing system that supports a declarative, SQL-like query language without changing the underlying query execution engine. We formalize the shared computation problem, present the optimization techniques in detail, and report evaluation results over both synthetic and real datasets. Our results show that, compared to the original query plans, the rewritten plans output by our cost-based optimizer can yield significantly higher (up to 16.8x) throughput.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。