Language-Integrated Recursive QueriesDistinguished paper award
Performance-critical applications, including large-scale program analyses, graph analyses, and distributed system analyses, rely on fixed-point computations. The introduction of recursion using the WITH RECURSIVE keyword in SQL:1999 extended the ability of relational database systems to handle fixed-point computations, unlocking significant performance advantages by allowing computation to move closer to the data. Yet, with recursion, SQL becomes a Turing-complete programming language with new correctness and safety risks.
Full SQL lacks a fixed semantics, as the SQL specification is written in natural language and is full of ambiguities that database vendors resolve in divergent ways. As a result, reasoning about the correctness of recursive SQL programs must rely on isolated, composable properties of queries rather than wrestling a unified formal model out of a language with notoriously inconsistent implementations across systems. To address these challenges, we propose a calculus, $\lambda_{RQL}$, that derives properties from embedded recursive queries using the host-language type system and, depending on the database backend, rejects queries that may lead to the three classes of recursive query errors - runtime database exceptions, incorrect results, and non-termination. Queries that respect all properties are guaranteed to find the minimal fixed point in a finite number of steps.
We introduce TyQL, a practical implementation in Scala for safe, recursive language-integrated query. TyQL uses modern type system features of Scala 3, namely Named-Tuples and type-level pattern matching, to ensure query portability and safety. TyQL shows no performance penalty compared to SQL queries expressed as embedded strings while enabling a three-order-of-magnitude speedup over non-recursive SQL queries.
Thu 2 JulDisplayed time zone: Brussels, Copenhagen, Madrid, Paris change
11:00 - 12:30 | |||
11:00 22mTalk | A Variation on Java Wildcards - Trading Expressiveness for Global Type Inference Technical Papers Andreas Stadelmeier DHBW Baden-Wuerttemberg Cooperative State University, Peter Thiemann University of Freiburg, Martin Plümicke DHBW Stuttgart, Campus Horb, Germany | ||
11:22 22mTalk | Ownership Refinement Types for Pointer Arithmetic and Nested Arrays Technical Papers Yusuke Fujiwara Kyoto University, Japan, Yusuke Matsushita Kyoto University, Kohei Suenaga Graduate School of Informatics, Kyoto University, Atsushi Igarashi Kyoto University | ||
11:45 22mTalk | Language-Integrated Recursive QueriesDistinguished paper award Technical Papers Anna Herlihy EPFL, Amir Shaikhha University of Edinburgh, Anastasia Ailamaki EPFL, Martin Odersky EPFL | ||
12:07 22mTalk | NEST: Network Enforced Session Types Technical Papers Jens Kanstrup Larsen DTU, Alceste Scalas Technical University of Denmark, Guy Amir Hebrew University, Jules Jacobs Cornell University, Jana Wagemaker Radboud University, Nate Foster EPFL; Jane Street | ||