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/ .
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper8
- Auto-Tables: Synthesizing Multi-Step Transformations to Relationalize Tables without Using ExamplesPeng Li, Yeye He, Cong Yan, Yue Wang 等VLDB 2023 · 被引用 29 次
- EQUI-VOCAL: Synthesizing Queries for Compositional Video Events from Limited User InteractionsEnhao Zhang, Maureen Daum, Dong He, Brandon Haynes 等VLDB 2023 · 被引用 18 次
- Synthesizing analytical SQL queries from computation demonstrationXiangyu Zhou, Rastislav Bodík, Alvin Cheung, Chenglong WangPLDI 2022 · 被引用 11 次
- Automated Translation of Functional Big Data Queries to SQLGuoqiang Zhang, Benjamin Mariano, Xipeng Shen, Isil DilligOOPSLA 2023 · 被引用 5 次
- Relational Query Synthesis ⋈ Decision Tree LearningAaditya Naik, Aalok Thakkar, Adam Stein, Rajeev Alur 等VLDB 2024 · 被引用 2 次
它引用的顶会 Paper2
相关 Paper
- Example-guided synthesis of relational queriesAalok Thakkar, Aaditya Naik, Nathaniel Sands, Rajeev Alur 等PLDI 2021 · 被引用 12 次
- Guardrail: Automated Integrity Constraint Synthesis From Noisy DataPingchuan Ma, Zhaoyu Wang, Zhenlan Ji, Zongjie Li 等SIGMOD 2026 · 被引用 1 次
- SchemaRAG: A Schema-aware Retrieval-Augmented Generation Framework for Text-to-SQLDi Wu, Zetong Tang, Yi He, Xin LuoSIGMOD 2026 · 被引用 9 次
- Visualization by exampleChenglong Wang, Yu Feng, Rastislav Bodík, Alvin Cheung 等POPL 2020 · 被引用 36 次
- FeatAug: Automatic Feature Augmentation From One-to-Many Relationship TablesDanrui Qi, Weiling Zheng, Jiannan WangICDE 2024 · 被引用 3 次
