arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2602.21955cs.DB
收藏

检测数据库管理系统中连接优化的逻辑错误

Detecting Logic Bugs of Join Optimizations in DBMS

Zhejiang University(浙江大学);Alibaba Group(阿里巴巴集团)

Xiu Tang, Sai Wu, Dongxiang Zhang, Feifei Li, Gang Chen

AI总结:

TQS是一种新型测试框架,用于检测数据库管理系统中多表连接查询的逻辑错误,通过数据引导的模式和查询生成技术有效发现115个错误。

摘要:

基于生成的测试技术在检测数据库管理系统中的逻辑错误方面已显示出其有效性,这些错误通常由查询优化器的不当实现引起。然而,现有的基于生成的调试工具仅限于单表查询,对于涉及连接操作符的多表查询存在显著的研究空白。在本文中,我们提出TQS,一种针对涉及多表连接的查询中衍生出的逻辑错误的新型测试框架。给定一个目标数据库管理系统,TQS通过两个关键组件实现目标:数据引导的模式和查询生成(DSG)以及知识引导的查询空间探索(KQE)。DSG解决了多表查询调试的核心挑战:如何为验证生成真实的(查询,结果)对。它采用数据库规范化技术生成测试模式,并维护位图索引用于结果跟踪。为了提高调试效率,DSG还人为地在生成的数据中插入一些噪声。为了避免重复的查询空间搜索,KQE将问题表述为同构图集发现,并结合图嵌入和加权随机游走进行查询生成。我们评估了TQS在四个流行的数据库管理系统上:MySQL、MariaDB、TiDB和一家行业领先的云原生数据库的灰发布版本,匿名称为X-DB。实验结果表明,TQS在发现数据库管理系统中的连接优化逻辑错误方面是有效的。它在24小时内成功检测到115个错误,包括MySQL中的31个错误,MariaDB中的30个错误,TiDB中的31个错误,以及X-DB中的23个错误。

英文摘要:

Generation-based testing techniques have shown their effectiveness in detecting logic bugs of DBMS, which are often caused by improper implementation of query optimizers. Nonetheless, existing generation-based debug tools are limited to single-table queries and there is a substantial research gap regarding multi-table queries with join operators. In this paper, we propose TQS, a novel testing framework targeted at detecting logic bugs derived by queries involving multi-table joins. Given a target DBMS, TQS achieves the goal with two key components: Data-guided Schema and Query Generation (DSG) and Knowledge-guided Query Space Exploration (KQE). DSG addresses the key challenge of multi-table query debugging: how to generate ground-truth (query, result) pairs for verification. It adopts the database normalization technique to generate a testing schema and maintains a bitmap index for result tracking. To improve debug efficiency, DSG also artificially inserts some noises into the generated data. To avoid repetitive query space search, KQE forms the problem as isomorphic graph set discovery and combines the graph embedding and weighted random walk for query generation. We evaluated TQS on four popular DBMSs: MySQL, MariaDB, TiDB and the gray release of an industry-leading cloud-native database, anonymized as X-DB. Experimental results show that TQS is effective in finding logic bugs of join optimization in database management systems. It successfully detected 115 bugs within 24 hours, including 31 bugs in MySQL, 30 in MariaDB, 31 in TiDB, and 23 in X-DB respectively.

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

↑