Functional collection programming with semi-ring dictionaries
Amir Shaikhha, Mathieu Huot, Jaclyn Smith, Dan Olteanu
Abstract
This paper introduces semi-ring dictionaries, a powerful class of compositional and purely functional collections that subsume other collection types such as sets, multisets, arrays, vectors, and matrices. We developed SDQL, a statically typed language that can express relational algebra with aggregations, linear algebra, and functional collections over data such as relations and matrices using semi-ring dictionaries. Furthermore, thanks to the algebraic structure behind these dictionaries, SDQL unifies a wide range of optimizations commonly used in databases (DB) and linear algebra (LA). As a result, SDQL enables efficient processing of hybrid DB and LA workloads, by putting together optimizations that are otherwise confined to either DB systems or LA frameworks. We show experimentally that a handful of DB and LA workloads can take advantage of the SDQL language and optimizations. SDQL can be competitive with or outperforms a host of systems that are state of the art in their own domain: in-memory DB systems Typer and Tectorwise for (flat, not nested) relational data; SciPy for LA workloads; sparse tensor compiler taco; the Trance nested relational engine; and the in-database machine learning engines LMFAO and Morpheus for hybrid DB/LA workloads over relational data.
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 824e848a-e56c-4dd1-850c-39705fcc6352Cited by top-tier papers16
- Optimizing Tensor Programs on Flexible StorageMaximilian Schleich, Amir Shaikhha, Dan SuciuSIGMOD 2023 · 21 citations
- Indexed Streams: A Formal Intermediate Representation for Fused Contraction ProgramsScott Kovach, Praneeth Kolichala, Tiancheng Gu, Fredrik KjolstadPLDI 2023 · 11 citations
- Compiling Structured Tensor AlgebraMahdi Ghorbani, Mathieu Huot, Shideh Hashemian, Amir ShaikhhaOOPSLA 2023 · 10 citations
- Avoiding Materialisation for Guarded Aggregate QueriesMatthias Lanzinger, Reinhard Pichler, Alexander SelzerVLDB 2025 · 7 citations
- Finch: Sparse and Structured Tensor Programming with Control FlowWillow Ahrens, Teodoro Fields Collin, Radha Patel, Kyle Deeds et al.OOPSLA 2025 · 6 citations
Builds on1
Related papers
- A Compiler for Fused Relational Operations on MultisetsJames Dong, Fredrik KjolstadPLDI 2026
- MojoFrame: Dataframe Library in Mojo LanguageShengya Huang, Zhaoheng Li, Derek Werner, Yongjoo ParkICDE 2026
- Query Processing on Tensor Computation RuntimesDong He, Supun Chathuranga Nakandala, Dalitso Banda, Rathijit Sen et al.VLDB 2022 · 54 citations
- Tensor Relational Algebra for Distributed Machine Learning System DesignBinhang Yuan, Dimitrije Jankov, Jia Zou, Yuxin Tang et al.VLDB 2021 · 33 citations
- Semiring optimizations: dynamic elision of expressions with identity and absorbing elementsGuilherme V. Leobas, Fernando Magno Quintão PereiraOOPSLA 2020 · 9 citations
