Skip to main content
QUICK REVIEW

[论文解读] CUBES: A Parallel Synthesizer for SQL Using Examples

Ricardo Brancas, Miguel Terra-Neves|arXiv (Cornell University)|Mar 9, 2022
Advanced Database Systems and Queries被引用 4
一句话总结

CUBES 是一种并行 SQL 生成器,利用输入-输出示例生成查询,通过多核架构上的分治并行化以及基于模糊测试的消歧过程来提高准确性。它在匹配用户意图方面达到了 60% 的准确率,显著高于以往工具,同时在困难实例上实现了超线性加速。

ABSTRACT

In recent years, more people have seen their work depend on data manipulation tasks. However, many of these users do not have the background in programming required to write complex programs, particularly SQL queries. One way of helping these users is automatically synthesizing the SQL query given a small set of examples. Several program synthesizers for SQL have been recently proposed, but they do not leverage multicore architectures. This paper proposes CUBES, a parallel program synthesizer for the domain of SQL queries using input-output examples. Since input-output examples are an under-specification of the desired SQL query, sometimes, the synthesized query does not match the user's intent. CUBES incorporates a new disambiguation procedure based on fuzzing techniques that interacts with the user and increases the confidence that the returned query matches the user intent. We perform an extensive evaluation on around 4000 SQL queries from different domains. Experimental results show that our sequential version can solve more instances than other state-of-the-art SQL synthesizers. Moreover, the parallel approach can scale up to 16 processes with super-linear speedups for many hard instances. Our disambiguation approach is critical to achieving an accuracy of around 60%, significantly larger than other SQL synthesizers.

研究动机与目标

  • 解决现有 SQL 生成器在未利用多核架构情况下的可扩展性限制。
  • 通过解决满足相同输入-输出示例但语义不同的多个正确查询之间的歧义,提高生成查询的准确性。
  • 通过模糊测试生成的测试用例与用户进行交互式消歧,以优化查询选择并匹配用户意图。
  • 通过在并行框架中采用剪枝技术与领域特定语言(DSL)拆分,扩展 SQL 查询生成的表达能力和效率。
  • 为未来研究评估提供一个约 4000 个 SQL 生成实例的公开基准。

提出的方法

  • 将顺序式 SQL 生成器改造为支持更丰富的查询语言并引入剪枝启发式方法,以减少无效程序的枚举。
  • 实现分治并行化策略,每个进程通过分配不同的操作序列和 DSL 片段,独立探索 DSL 的不同子集。
  • 使用模糊测试自动生成新的测试用例(输入表),使候选查询产生不同的输出,从而实现有针对性的消歧。
  • 通过交互式询问用户对这些模糊测试用例输出正确性的判断,迭代地排除错误的候选查询。
  • 通过动态增加每个线程的 DSL 操作数量,实现负载均衡并避免饥饿,确保任务在各进程间合理分配。
  • 将消歧循环集成到生成流水线中,持续优化结果,直至用户意图被可靠匹配。

实验结果

研究问题

  • RQ1基于输入-输出示例的并行查询生成器是否能在解决复杂 SQL 生成问题方面超越顺序式最先进工具?
  • RQ2多核系统中的并行性在多大程度上能提升 SQL 查询生成的性能与可扩展性?
  • RQ3基于模糊测试的交互式消歧过程在将生成查询的准确率提升至超过 50% 基线水平方面有多有效?
  • RQ4剪枝技术与 DSL 拆分是否能显著缩小搜索空间,同时保持 SQL 生成的表达能力?
  • RQ5当以与用户意图的一致性而非仅句法正确性作为衡量标准时,查询生成工具的准确率如何比较?

主要发现

  • CUBES 的顺序版本比现有最先进工具能解决更多的 SQL 生成实例,证明了其更高的完备性与鲁棒性。
  • CUBES 的并行版本在许多困难实例上实现了超线性加速,当使用 16 个进程时,中位加速比达到 15×。
  • 在无消歧机制的情况下,现有生成器在匹配用户意图方面的准确率低于 50%,表明其在实际可用性方面存在关键缺陷。
  • 通过提出的基于模糊测试的消歧机制,CUBES 将准确率提升至约 60%,显著优于以往工具。
  • 该框架成功处理了涵盖多个领域、约 4000 个 SQL 查询的多样化基准,包括基于扩展自然语言的示例。
  • 通过用户对模糊测试用例输出的反馈实现的交互式消歧,即使在输入-输出示例存在歧义的情况下,也能可靠识别出用户意图的查询。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。