YeSQL: "You extend SQL" with Rich and Highly Performant User-Defined Functions in Relational Databases
Yannis E. Foufoulas, Alkis Simitsis, Eleftherios Stamatogiannakis, Yannis E. Ioannidis
Abstract
The diversity and complexity of modern data management applications have led to the extension of the relational paradigm with syntactic and semantic support for User-Defined Functions (UDFs). Although well-established in traditional DBMS settings, UDFs have become central in many application contexts as well, such as data science, data analytics, and edge computing. Still, a critical limitation of UDFs is the impedance mismatch between their evaluation and relational processing. In this paper, we present YeSQL, an SQL extension with rich UDF support along with a pluggable architecture to easily integrate it with either server-based or embedded database engines. YeSQL currently supports Python UDFs fully integrated with relational queries as scalar, aggregator, or table functions. Key novel characteristics of YeSQL include easy implementation of complex algorithms and several performance enhancements, including tracing JIT compilation of Python UDFs, parallelism and fusion of UDFs, stateful UDFs, and seamless integration with a database engine. Our experimental analysis showcases the usability and expressiveness of YeSQL and demonstrates that our techniques of minimizing context switching between the relational engine and the Python VM are very effective and achieve significant speedups up to 68x in common, practical use cases compared to earlier approaches and alternative implementation choices.
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.
3 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
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
- Declarative Sub-Operators for Universal Data Processing cites Procedural Extensions of SQL: Understanding their usage in the wild
- Predicate Pushdown for Data Science Pipelines cites Aggify: Lifting the Curse of Cursor Loops using Custom Aggregates
- Predicate Pushdown for Data Science Pipelines cites Tuplex: Data Science in Python at Native Code Speed
- HiPy: Extracting High-Level Semantics from Python Code for Data Processing cites Tuplex: Data Science in Python at Native Code Speed
Cited by top-tier papers3
- Declarative Sub-Operators for Universal Data ProcessingMichael Jungmair, Jana GicevaVLDB 2023 · 17 citations
- Predicate Pushdown for Data Science PipelinesCong Yan, Yin Lin, Yeye HeSIGMOD 2023 · 15 citations
- HiPy: Extracting High-Level Semantics from Python Code for Data ProcessingMichael Jungmair, Alexis Engelke, Jana GicevaOOPSLA 2024 · 7 citations
Builds on3
- Procedural Extensions of SQL: Understanding their usage in the wildSurabhi Gupta, Karthik RamachandraVLDB 2021 · 34 citations
- Tuplex: Data Science in Python at Native Code SpeedLeonhard F. Spiegelberg, Rahul Yesantharao, Malte Schwarzkopf, Tim KraskaSIGMOD 2021 · 32 citations
- Aggify: Lifting the Curse of Cursor Loops using Custom AggregatesSurabhi Gupta, Sanket Purandare, Karthik RamachandraSIGMOD 2020 · 22 citations
Related papers
- User-Defined Operators: Efficiently Integrating Custom Algorithms into Modern DatabasesMoritz Sichert, Thomas NeumannVLDB 2022 · 23 citations
- Udon: Efficient Debugging of User-Defined Functions in Big Data Systems with Line-by-Line ControlYicong Huang, Zuozhi Wang, Chen LiSIGMOD 2024 · 6 citations
- QURE: AI-Assisted and Automatically Verified UDF InliningTarique Siddiqui, Arnd Christian König, Jiashen Cao, Cong Yan et al.SIGMOD 2025 · 2 citations
- The UDFBench Benchmark for General-purpose UDF QueriesYannis Foufoulas, Theoni Palaiologou, Alkis SimitsisVLDB 2025
- MONSOON: Multi-Step Optimization and Execution of Queries with Partially Obscured PredicatesSourav Sikdar, Chris JermaineSIGMOD 2020 · 6 citations
