Table of Contents
Fetching ...

CUBES: A Parallel Synthesizer for SQL Using Examples

Ricardo Brancas, Miguel Terra-Neves, Miguel Ventura, Vasco Manquinho, Ruben Martins

TL;DR

The paper tackles the challenge of automatically synthesizing SQL queries from input-output examples for users lacking programming expertise. It introduces Cubes, a parallel, division-based synthesizer that extends a sequential baseline with a larger DSL and pruning to prune invalid programs, enabling scalable search. A key contribution is the fuzzing-based disambiguation procedure, which iteratively refines candidate queries by querying the user with new example inputs to better capture user intent, achieving significantly higher accuracy than prior work. Evaluations on roughly 4000 instances show that the parallel Cubes-DC with up to 16 processes yields strong super-linear speedups and higher solved-instance coverage, while disambiguation raises accuracy toward 60% and demonstrates practical utility for real-world tasks.

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.

CUBES: A Parallel Synthesizer for SQL Using Examples

TL;DR

The paper tackles the challenge of automatically synthesizing SQL queries from input-output examples for users lacking programming expertise. It introduces Cubes, a parallel, division-based synthesizer that extends a sequential baseline with a larger DSL and pruning to prune invalid programs, enabling scalable search. A key contribution is the fuzzing-based disambiguation procedure, which iteratively refines candidate queries by querying the user with new example inputs to better capture user intent, achieving significantly higher accuracy than prior work. Evaluations on roughly 4000 instances show that the parallel Cubes-DC with up to 16 processes yields strong super-linear speedups and higher solved-instance coverage, while disambiguation raises accuracy toward 60% and demonstrates practical utility for real-world tasks.

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.
Paper Structure (59 sections, 5 equations, 19 figures, 6 tables, 2 algorithms)

This paper contains 59 sections, 5 equations, 19 figures, 6 tables, 2 algorithms.

Figures (19)

  • Figure 1: Two input tables: Courses and Grades. Output table: number of grades per course.
  • Figure 2: Diagram of sequential enumeration-based synthesizer architecture.
  • Figure 3: DSL used by the Cubes synthesizer. New components are highlighted in bold.
  • Figure 4: Inference rules used to determine valid programs. $A'$ denotes the first annotation of element $A$, while $A"$ denotes the second annotation. Where not mentioned, it is assumed that the second annotation is $= \emptyset$.
  • Figure 5: Semantics of each annotation. $A'$ denotes the first annotation of $A$ and $A"$ denotes the second annotation.
  • ...and 14 more figures