arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2007.08292cs.SEcs.DB
收藏

通过非优化参考引擎构造检测数据库引擎中的优化错误

Detecting Optimization Bugs in Database Engines via Non-Optimizing Reference Engine Construction

Manuel Rigger, Zhendong Su

摘要:

数据库管理系统(DBMS)被广泛使用。为了有效地访问数据,他们应用了复杂的优化。不正确的优化可能会导致逻辑错误,从而导致查询计算出不正确的结果集。我们提出了非优化引用引擎构造(NoREC),一种全自动的方法来检测DBMS中的优化错误。从概念上讲,这种方法旨在通过优化和非优化版本的DBMS来评估查询,然后检测它们返回的结果集中的差异,这将表明DBMS中存在错误。获得DBMS的非优化版本是具有挑战性的,因为DBMS通常对优化提供有限的控制。我们的核心见解是,一个给定的,潜在的随机生成的优化查询可以重写为一个DBMS不能优化。评估该未优化的查询有效地对应于执行原始查询的非优化引用引擎。我们在四个广泛使用的DBMS上进行了广泛的测试活动,即PostgreSQL,MariaDB,SQLite和CockroachDB。我们在这些系统的最新版本中发现了159个以前未知的错误,其中141个已经被开发人员修复。其中,51个是优化错误,其余的是错误和崩溃错误。我们的研究结果表明,NoREC是有效的,通用的,需要很少的实施工作,这使得该技术在实践中广泛适用。

英文摘要:

Database Management Systems (DBMS) are used ubiquitously. To efficiently access data, they apply sophisticated optimizations. Incorrect optimizations can result in logic bugs, which cause a query to compute an incorrect result set. We propose Non-Optimizing Reference Engine Construction (NoREC), a fully-automatic approach to detect optimization bugs in DBMS. Conceptually, this approach aims to evaluate a query by an optimizing and a non-optimizing version of a DBMS, to then detect differences in their returned result set, which would indicate a bug in the DBMS. Obtaining a non-optimizing version of a DBMS is challenging, because DBMS typically provide limited control over optimizations. Our core insight is that a given, potentially randomly-generated optimized query can be rewritten to one that the DBMS cannot optimize. Evaluating this unoptimized query effectively corresponds to a non-optimizing reference engine executing the original query. We evaluated NoREC in an extensive testing campaign on four widely-used DBMS, namely PostgreSQL, MariaDB, SQLite, and CockroachDB. We found 159 previously unknown bugs in the latest versions of these systems, 141 of which have been fixed by the developers. Of these, 51 were optimization bugs, while the remaining were error and crash bugs. Our results suggest that NoREC is effective, general and requires little implementation effort, which makes the technique widely applicable in practice.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑