Join queries involving many relations pose a severe challenge to today's query optimisation techniques. To some extent, this is due to the fact that these techniques do not pay sufficient attention to structural properties of the query. In stark contrast, the Database Theory community has intensively studied structural properties of queries (such as acyclicity and various notions of width) and proposed efficient query evaluation techniques through variants of Yannakakis' algorithm. However, although most queries in practice actually are acyclic or have low width, structure-guided query evaluation techniques based on Yannakakis' algorithm have not found their way into mainstream database technology yet. The goal of this work is to address this gap between theory and practice and to demonstrate that the consideration of query structure can improve query evaluation performance on modern DBMSs significantly in cases that have been traditionally challenging. In particular, we study the performance of structure-guided query evaluation in three architecturally distinct DBMSs by rewriting SQL queries into a sequence of SQL statements that express an execution of Yannakakis' algorithm. Moreover, we identify a class of queries that is particularly well suited for our approach and allows query answering in a variety of common scenarios without materializing any join. Through empirical evaluation we show that structure-guided query evaluation can make the evaluation of many difficult join queries feasible whereas their evaluation requires a prohibitive amount of time and memory on current DBMSs.
翻译:涉及多个关系的连接查询对当今查询优化技术构成了严峻挑战。某种程度上,这是由于这些技术未充分关注查询的结构属性。与此形成鲜明对比的是,数据库理论界已深入研究查询的结构属性(如无环性与各类宽度概念),并通过Yannakakis算法的变体提出了高效的查询评估技术。然而,尽管实际应用中大多数查询确实属于无环或低宽度类型,基于Yannakakis算法的结构引导查询评估技术至今仍未融入主流数据库技术。本工作旨在弥合理论与实践的鸿沟,论证在传统具有挑战性的场景中,考虑查询结构能显著提升现代DBMS的查询评估性能。具体而言,我们通过将SQL查询重写为表达Yannakakis算法执行过程的SQL语句序列,在三种架构不同的DBMS中研究了结构引导查询评估的性能。此外,我们识别出一类特别适合该方法论的查询,使其能够在无需物化任何连接的情况下,在多种常见场景中实现查询应答。通过实证评估,我们证明结构引导查询评估能使许多原本在现有DBMS上需要消耗巨量时间与内存的困难连接查询变得可行。