Write a Blog >>
Tue 20 Jun 2017 14:50 - 15:15 at Aula Master - Functional Programming and Correctness Chair(s): Francesco Logozzo

Every database system contains a query optimizer that performs query rewrites. Unfortunately, developing query optimizers remains a highly challenging task. Part of the challenges comes from the intricacies and rich features of query languages, which makes reasoning about rewrite rules difficult. In this paper, we propose a machine-checkable denotational semantics for SQL, the de facto language for relational database, for rigorously validating rewrite rules. Unlike previously proposed semantics that are either non-mechanized or only cover a small amount of SQL language features, our semantics covers all major features of SQL, including bags, correlated subqueries, aggregation, and indexes. Our mechanized semantics, called HoTT SQL, is based on K-Relations and homotopy type theory, where we denote relations as mathematical functions from tuples to univalent types. We have implemented HoTTSQL in Coq, which takes only fewer than 300 lines of code and have proved a wide range of SQL rewrite rules, including those from database research literature (e.g., magic set rewrites) and real-world query optimizers (e.g., subquery elimination). Several of these rewrite rules have never been previously proven correct. In addition, while query equivalence is generally undecidable, we have implemented an automated decision procedure using HoTTSQL for conjunctive queries: a well studied decidable fragment of SQL that encompasses many real-world queries.

Tue 20 Jun

pldi-2017-papers
14:00 - 15:40: PLDI Research Papers - Functional Programming and Correctness at Aula Master
Chair(s): Francesco LogozzoFacebook
pldi-2017-papers149796000000014:00 - 14:25
Talk
Luke MaurerUniversity of Oregon, USA, Paul DownenUniversity of Oregon, USA, Zena M. AriolaUniversity of Oregon, USA, Simon Peyton JonesMicrosoft Research, Cambridge
Media Attached
pldi-2017-papers149796150000014:25 - 14:50
Talk
Daniel PattersonNortheastern University, Jamie PercontiNortheastern University, Christos DimoulasHarvard University, USA, Amal AhmedNortheastern University, USA
Media Attached
pldi-2017-papers149796300000014:50 - 15:15
Talk
Shumo ChuUniversity of Washington, USA, Konstantin WeitzUniversity of Washington, USA, Alvin CheungUniversity of Washington, Dan SuciuUniversity of Washington
Media Attached
pldi-2017-papers149796450000015:15 - 15:40
Talk
Richard A. EisenbergBryn Mawr College, USA, Simon Peyton JonesMicrosoft Research, Cambridge
Media Attached