Functional Programming on Top of SQL Engines
summary
The work claims a non‑invasive, SQL‑level compiler that turns recursion‑heavy SQL UDFs into a single WITH RECURSIVE query so the engine plans once, supports memoization, and runs much faster. It applies a pipeline of CPS conversion, defunctionalization, and trampolined style rewrites to emit iterative CTEs; a Floyd‑Warshall example shows ~88,000 UDF planning events avoided and speedups of 10× or more in experiments.
AI-written summary · about
chapters (9)
- 0:00Functional programming on SQL
- 2:12Moving computation close to data
- 6:26Graph algorithms and SQL recursion
- 9:16Recursive SQL UDFs and functional style
- 13:27Performance overhead of recursive UDFs
- 15:32Optimizing UDFs as functions
- 20:50Functional transformations for SQL
- 23:40Generating efficient recursive CTEs
- 25:24Performance gains and applications
related talks
14mUDF to SQL Translation through Compositional Lazy Inductive Synthesis
44mFunctional Programming You Already Know
41mFunctional Programming for Dummies*
58mFunctional Programming with C#
16mA Compiler for Fused Relational Operations on Multisets
43mDatafun: a functional query language
49mFunctional Programming Essentials
56mFunctional Programming with JavaScript
