Optimization of Imperative Programs in a Relational Database
Not on the map. Why?
Abstract (arXiv)
For decades, RDBMSs have supported declarative SQL as well as imperative functions and procedures as ways for users to express data processing tasks. While the evaluation of declarative SQL has received a lot of attention resulting in highly sophisticated techniques, the evaluation of imperative programs has remained naive and highly inefficient. Imperative programs offer several benefits over SQL and hence are often preferred and widely used. But unfortunately, their abysmal performance discourages, and even prohibits their use in many situations. We address this important problem that has hitherto received little attention. We present Froid, an extensible framework for optimizing imperative programs in relational databases. Froid's novel approach automatically transforms entire User Defined Functions (UDFs) into relational algebraic expressions, and embeds them into the calling SQL query. This form is now amenable to cost-based optimization and results in efficient, set-oriented, parallel plans as opposed to inefficient, iterative, serial execution of UDFs. Froid's approach additionally brings the benefits of many compiler optimizations to UDFs with no additional implementation effort. We describe the design of Froid and present our experimental evaluation that demonstrates performance improvements of up to multiple orders of magnitude on real workloads.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). First posted on arXiv 1 Dec 2017.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 2; 2023: 1; 2024: 0; 2025: 0; 2026: 2.
5 papers.
- 2022End-to-end Optimization of Machine Learning Prediction Queriescited by 16
- 2022Analytical Engines With Context-Rich Processing: Towards Efficient Next-Generation Analyticscited by 4
- 2023A Comparison of Decision Forest Inference Platforms from A Database Perspectivecited by 3
- 2026Automating Database-Native Function Code Synthesis with LLMscited by 2
- 2026Credo: Reusable Declarative Primitives for Agentic Workflowscited by 0
- 2026Credo: Reusable Declarative Primitives for Agentic Workflows28 Aug 2026
- 2026Automating Database-Native Function Code Synthesis with LLMs2 Apr 2026
- 2023A Comparison of Decision Forest Inference Platforms from A Database Perspective9 Feb 2023
- 2022Analytical Engines With Context-Rich Processing: Towards Efficient Next-Generation Analytics14 Dec 2022
- 2022End-to-end Optimization of Machine Learning Prediction Queries31 May 2022