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)的查询评估性能。具体而言,我们通过在三种架构不同的DBMS中将SQL查询重写为表达Yannakakis算法执行过程的SQL语句序列,研究了结构引导查询评估的性能。此外,我们识别出一类特别适合此方法的查询,使得在多种常见场景下无需物化任何连接即可实现查询回答。通过实验评估,我们表明结构引导的查询评估可以使许多困难的连接查询的评估变得可行,而当前DBMS对这些查询的评估需要过高的时间和内存开销。