Reverse engineering complex join queries

Meihui Zhang, Hazem Elmeleegy, Cecilia M. Procopiuc, Divesh Srivastava

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

59 Citations (Scopus)

Abstract

We study the following problem: Given a database D with schema G and an output table Out, compute a join query Q that generates Out from D. A simpler variant allows Q to return a superset of Out. This problem has numerous applications, both by itself, and as a building block for other problems. Related prior work imposes conditions on the structure of Q which are not always consistent with the application, but simplify computation. We discuss several natural SQL queries that do not satisfy these conditions and cannot be discovered by prior work. In this paper, we propose an efficient algorithm that discovers queries with arbitrary join graphs. A crucial insight is that any graph can be characterized by the combination of a simple structure, called a star, and a series of merge steps over the star. The merge steps define a lattice over graphs derived from the same star. This allows us to explore the set of candidate solutions in a principled way and quickly prune out a large number of infeasible graphs. We also design several optimizations that significantly reduce the running time. Finally, we conduct an extensive experimental study over a benchmark database and show that our approach is scalable and accurately discovers complex join queries.

Original languageEnglish
Title of host publicationSIGMOD 2013 - International Conference on Management of Data
Pages809-820
Number of pages12
DOIs
Publication statusPublished - 2013
Externally publishedYes
Event2013 ACM SIGMOD Conference on Management of Data, SIGMOD 2013 - New York, NY, United States
Duration: 22 Jun 201327 Jun 2013

Publication series

NameProceedings of the ACM SIGMOD International Conference on Management of Data
ISSN (Print)0730-8078

Conference

Conference2013 ACM SIGMOD Conference on Management of Data, SIGMOD 2013
Country/TerritoryUnited States
CityNew York, NY
Period22/06/1327/06/13

Keywords

  • Query join graph
  • Query lattice
  • SQL query discovery

Fingerprint

Dive into the research topics of 'Reverse engineering complex join queries'. Together they form a unique fingerprint.

Cite this