Lune

VLDB2021顶会

PATSQL: Efficient Synthesis of SQL Queries from Example Tables with Quick Inference of Projected Columns

Keita Takenouchi, Takashi Ishio, Joji Okada, Yuji Sakata

摘要

SQL is one of the most popular tools for data analysis, and it is now used by an increasing number of users without having expertise in databases. Several studies have proposed programming-by-example approaches to help such non-experts to write correct SQL queries. While existing methods support a variety of SQL features such as aggregation and nested query, they suffer a significant increase in computational cost as the scale of example tables increases. In this paper, we propose an efficient algorithm utilizing properties known in relational algebra to synthesize SQL queries from input and output tables. Our key insight is that a projection operator in a program sketch can be lifted above other operators by applying transformation rules in relational algebra, while preserving the semantics of the program. This enables a quick inference of appropriate columns in the projection operator, which is an essential component in synthesis but causes combinatorial explosions in prior work. We also introduce a novel form of constraints and its top-down propagation mechanism for efficient sketch completion. We implemented this algorithm in our tool PATSQL and evaluated it on 226 queries from prior benchmarks and Kaggle's tutorials. As a result, PATSQL solved 68% of the benchmarks and found 89% of the solutions within a second. Our tool is available at https://naist-se.github.io/patsql/ .

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Relational Query Synthesis ⋈ Decision Tree Learning 引用了 Synthesizing analytical SQL queries from computation demonstration
  • Automated Translation of Functional Big Data Queries to SQL 引用了 Data Migration using Datalog Program Synthesis
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper8

  1. Auto-Tables: Synthesizing Multi-Step Transformations to Relationalize Tables without Using ExamplesPeng Li, Yeye He, Cong Yan, Yue Wang 等VLDB 2023 · 29 次引用
  2. EQUI-VOCAL: Synthesizing Queries for Compositional Video Events from Limited User InteractionsEnhao Zhang, Maureen Daum, Dong He, Brandon Haynes 等VLDB 2023 · 18 次引用
  3. Synthesizing analytical SQL queries from computation demonstrationXiangyu Zhou, Rastislav Bodík, Alvin Cheung, Chenglong WangPLDI 2022 · 11 次引用
  4. Automated Translation of Functional Big Data Queries to SQLGuoqiang Zhang, Benjamin Mariano, Xipeng Shen, Isil DilligOOPSLA 2023 · 5 次引用
  5. Relational Query Synthesis ⋈ Decision Tree LearningAaditya Naik, Aalok Thakkar, Adam Stein, Rajeev Alur 等VLDB 2024 · 2 次引用

它引用的 Paper2

  1. Data Migration using Datalog Program SynthesisYuepeng Wang, Rushi Shah, Abby Criswell, Rong Pan 等VLDB 2020 · 30 次引用
  2. Inductive program synthesis over noisy dataShivam Handa, Martin C. RinardFSE 2020 · 13 次引用

相关 Paper

  1. Example-guided synthesis of relational queriesAalok Thakkar, Aaditya Naik, Nathaniel Sands, Rajeev Alur 等PLDI 2021 · 12 次引用
  2. Pi-SQL: Enhancing Text-to-SQL with Fine-Grained Guidance from Pivot Programming LanguagesYongdong Chi, Hanqing Wang, Yun Chen, Yan Yang 等EMNLP Findings 2025
  3. Guardrail: Automated Integrity Constraint Synthesis From Noisy DataPingchuan Ma, Zhaoyu Wang, Zhenlan Ji, Zongjie Li 等SIGMOD 2026 · 1 次引用
  4. SchemaRAG: A Schema-aware Retrieval-Augmented Generation Framework for Text-to-SQLDi Wu, Zetong Tang, Yi He, Xin LuoSIGMOD 2026 · 9 次引用
  5. Visualization by exampleChenglong Wang, Yu Feng, Rastislav Bodík, Alvin Cheung 等POPL 2020 · 36 次引用
黄昏的海面,两侧是细线勾勒的悬崖