Lune

VLDB2024Top-tier venue

SQL Engines Excel at the Execution of Imperative Programs

Tim Fischer, Denis Hirn, Torsten Grust

Abstract

SQL query engines can act as efficient runtime environments for the execution of imperative programs over database-resident tabular data. To make this point, we lay out the details of a compilation strategy that maps the basic blocks of arbitrarily branching and looping control flow graphs into plain---possibly recursive---SQL:1999 common table expressions. The compiler does not stumble when faced with imperative programs of several hundred lines and emits SQL code that can execute such programs over entire batches of input arguments. These batches create opportunities for parallel program evaluation which contemporary query decorrelation techniques exploit automatically. SQL engines that already support UDFs may find the present program execution approach to outperform their native implementation---SQL engines without such support may gain UDF capabilities without the need to build a dedicated interpreter.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Procedural Extensions of SQL: Understanding their usage in the wild cites Aggify: Lifting the Curse of Cursor Loops using Custom Aggregates
  • UDF to SQL translation through compositional lazy inductive synthesis cites Aggify: Lifting the Curse of Cursor Loops using Custom Aggregates
  • One WITH RECURSIVE is Worth Many GOTOs cites Aggify: Lifting the Curse of Cursor Loops using Custom Aggregates
  • Automated Translation of Functional Big Data Queries to SQL cites UDF to SQL translation through compositional lazy inductive synthesis
  • The UDFBench Benchmark for General-purpose UDF Queries cites Procedural Extensions of SQL: Understanding their usage in the wild
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. The UDFBench Benchmark for General-purpose UDF QueriesYannis Foufoulas, Theoni Palaiologou, Alkis SimitsisVLDB 2025

Builds on5

  1. Procedural Extensions of SQL: Understanding their usage in the wildSurabhi Gupta, Karthik RamachandraVLDB 2021 · 34 citations
  2. Aggify: Lifting the Curse of Cursor Loops using Custom AggregatesSurabhi Gupta, Sanket Purandare, Karthik RamachandraSIGMOD 2020 · 22 citations
  3. One WITH RECURSIVE is Worth Many GOTOsDenis Hirn, Torsten GrustSIGMOD 2021 · 19 citations
  4. UDF to SQL translation through compositional lazy inductive synthesisGuoqiang Zhang, Yuanchao Xu, Xipeng Shen, Isil DilligOOPSLA 2021 · 14 citations
  5. Automated Translation of Functional Big Data Queries to SQLGuoqiang Zhang, Benjamin Mariano, Xipeng Shen, Isil DilligOOPSLA 2023 · 5 citations

Related papers

  1. Functional-Style SQL UDFs With a Capital 'F'Christian Duta, Torsten GrustSIGMOD 2020 · 11 citations
  2. Incremental Fusion: Unifying Compiled and Vectorized Query ExecutionBenjamin Wagner, André Kohn, Peter Boncz, Viktor LeisICDE 2024 · 3 citations
  3. MONSOON: Multi-Step Optimization and Execution of Queries with Partially Obscured PredicatesSourav Sikdar, Chris JermaineSIGMOD 2020 · 6 citations
  4. Babelfish: Efficient Execution of Polyglot QueriesPhilipp Marian Grulich, Steffen Zeuch, Volker MarklVLDB 2022 · 32 citations
  5. Containerized Execution of UDFs: An Experimental EvaluationKarla Saur, Tara Mirmira, Konstantinos Karanasos, Jesús Camacho-RodríguezVLDB 2022 · 14 citations
Dusk over the sea between two cliffs drawn in fine vertical lines