Relational Query Synthesis ⋈ Decision Tree Learning
Aaditya Naik, Aalok Thakkar, Adam Stein, Rajeev Alur, Mayur Naik
Abstract
We study the problem of synthesizing a core fragment of relational queries called select-project-join (SPJ) queries from input-output examples. Search-based synthesis techniques are suited to synthesizing projections and joins by navigating the network of relational tables but require additional supervision for synthesizing comparison predicates. On the other hand, decision tree learning techniques are suited to synthesizing comparison predicates when the input database can be summarized as a single labelled relational table. In this paper, we adapt and interleave methods from the domains of relational query synthesis and decision tree learning, and present an end-to-end framework for synthesizing relational queries with categorical and numerical comparison predicates. Our technique guarantees the completeness of the synthesis procedure and strongly encourages minimality of the synthesized program. We present Libra, an implementation of this technique and evaluate it on a benchmark suite of 1,475 instances of queries over 159 databases with multiple tables. Libra solves 1,361 of these instances in an average of 59 seconds per instance. It outperforms state-of-the-art program synthesis tools Scythe and PatSQL in terms of both the running time and the quality of the synthesized programs.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Builds on7
- Provenance-guided synthesis of Datalog programsMukund Raghothaman, Jonathan Mendelson, David Zhao, Mayur Naik et al.POPL 2020 · 49 citations
- Reconciling enumerative and deductive program synthesisKangjing Huang, Xiaokang Qiu, Peiyuan Shen, Yanjun WangPLDI 2020 · 46 citations
- PATSQL: Efficient Synthesis of SQL Queries from Example Tables with Quick Inference of Projected ColumnsKeita Takenouchi, Takashi Ishio, Joji Okada, Yuji SakataVLDB 2021 · 19 citations
- GENSYNTH: Synthesizing Datalog Programs without Language BiasJonathan Mendelson, Aaditya Naik, Mukund Raghothaman, Mayur NaikAAAI 2021 · 14 citations
- ARDA: Automatic Relational Data Augmentation for Machine LearningNadiia Chepurko, Ryan Marcus, Emanuel Zgraggen, Raul Castro Fernandez et al.VLDB 2020 · 14 citations
Related papers
- Example-guided synthesis of relational queriesAalok Thakkar, Aaditya Naik, Nathaniel Sands, Rajeev Alur et al.PLDI 2021 · 12 citations
- Synthesizing Graph Queries from DemonstrationsXiaoyu Liu, Qikang Liu, Evan Dyce, Keval Vora et al.OOPSLA 2026
- Mobius: Synthesizing Relational Queries with Recursive and Invented PredicatesAalok Thakkar, Nathaniel Sands, George Petrou, Rajeev Alur et al.OOPSLA 2023 · 5 citations
- Athena: An Effective Learning-based Framework for Query Optimizer Performance ImprovementRunzhong Li, Qilong Li, Haotian Liu, Rui Mao et al.SIGMOD 2025 · 3 citations
- SIA: Optimizing Queries using Learned PredicatesQi Zhou, Joy Arulraj, Shamkant B. Navathe, William Harris et al.SIGMOD 2021 · 11 citations
