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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 132995f8-39fe-4b39-95b0-10a8d50e8a30Cited by top-tier papers1
Ask how each one uses itBuilds on5
- Procedural Extensions of SQL: Understanding their usage in the wildSurabhi Gupta, Karthik RamachandraVLDB 2021 · 34 citations
- Aggify: Lifting the Curse of Cursor Loops using Custom AggregatesSurabhi Gupta, Sanket Purandare, Karthik RamachandraSIGMOD 2020 · 22 citations
- One WITH RECURSIVE is Worth Many GOTOsDenis Hirn, Torsten GrustSIGMOD 2021 · 19 citations
- UDF to SQL translation through compositional lazy inductive synthesisGuoqiang Zhang, Yuanchao Xu, Xipeng Shen, Isil DilligOOPSLA 2021 · 14 citations
- Automated Translation of Functional Big Data Queries to SQLGuoqiang Zhang, Benjamin Mariano, Xipeng Shen, Isil DilligOOPSLA 2023 · 5 citations
Related papers
- Functional-Style SQL UDFs With a Capital 'F'Christian Duta, Torsten GrustSIGMOD 2020 · 11 citations
- Incremental Fusion: Unifying Compiled and Vectorized Query ExecutionBenjamin Wagner, André Kohn, Peter Boncz, Viktor LeisICDE 2024 · 3 citations
- MONSOON: Multi-Step Optimization and Execution of Queries with Partially Obscured PredicatesSourav Sikdar, Chris JermaineSIGMOD 2020 · 6 citations
- Babelfish: Efficient Execution of Polyglot QueriesPhilipp Marian Grulich, Steffen Zeuch, Volker MarklVLDB 2022 · 32 citations
- Containerized Execution of UDFs: An Experimental EvaluationKarla Saur, Tara Mirmira, Konstantinos Karanasos, Jesús Camacho-RodríguezVLDB 2022 · 14 citations
