SQL query performance is critical in database applications, and query rewriting is a technique that transforms an original query into an equivalent query with a better performance. In a wide range of database-supported systems, there is a unique problem where both the application and database layer are black boxes, and the developers need to use their knowledge about the data and domain to rewrite queries sent from the application to the database for better performance. Unfortunately, existing solutions do not give the users enough freedom to express their rewriting needs. To address this problem, we propose QueryBooster, a novel middleware-based service architecture for human-centered query rewriting, where users can use its expressive and easy-to-use rule language (called VarSQL) to formulate rewriting rules based on their needs. It also allows users to express rewriting intentions by providing examples of the original query and its rewritten query. QueryBooster automatically generalizes them to rewriting rules and suggests high-quality ones. We conduct a user study to show the benefits of VarSQL to formulate rewriting rules. Our experiments on real and synthetic workloads show the effectiveness of the rule-suggesting framework and the significant advantages of using QueryBooster for human-centered query rewriting to improve the end-to-end query performance.
翻译:在数据库应用中,SQL查询性能至关重要,而查询重写是一种将原始查询转化为性能更优的等价查询的技术。在众多基于数据库的系统中,存在一个独特问题:应用层和数据库层均为黑盒,开发人员需要利用自身对数据和领域的知识,对从应用发送至数据库的查询进行重写以提升性能。然而,现有解决方案未能赋予用户足够自由度以表达其重写需求。为解决此问题,我们提出QueryBooster,一种新颖的基于中间件的服务架构,用于实现以人为本的查询重写。用户可通过其表达力强且易于使用的规则语言(称为VarSQL)根据自身需求制定重写规则。该架构还允许用户通过提供原始查询及其重写后的查询示例来表达重写意图。QueryBooster能自动将这些示例泛化为重写规则,并推荐高质量规则。我们通过用户研究证明了VarSQL在制定重写规则方面的优势。在真实与合成工作负载上的实验表明,规则推荐框架的有效性,以及使用QueryBooster进行以人为本的查询重写在提升端到端查询性能方面的显著优势。