Freedom for the SQL-Lambda: Just-in-Time-Compiling User-Injected Functions in PostgreSQL

Maximilian E. Schüle, Jakob Huber, Alfons Kemper, Thomas Neumann

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

2 Scopus citations

Abstract

As part of the code-generating database system HyPer, SQL lambda functions allow user-defined metrics to be injected into data mining operators during compile time. Since version 11, PostgreSQL has supported just-in-Time compilation with LLVM for expression evaluation. This enables the concept of SQL lambda functions to be transferred to this open-source database system. In this study, we extend PostgreSQL by adding two subquery types for lambda expressions that either pre-materialise the result or return a cursor to request tuples. We demonstrate the usage of these subquery types in conjunction with dedicated table functions for data mining algorithms such as PageRank, k-Means clustering and labelling. Furthermore, we allow four levels of optimisation for query execution, ranging from interpreted function calls to just-in-Time-compiled execution. The latter-with some adjustments to the PostgreSQL's execution engine-transforms our lambda functions into real user-injected code. In our evaluation with the LDBC social network benchmark for PageRank and the Chicago taxi data set for clustering, optimised lambda functions achieved comparable performance to hard-coded implementations and HyPer's data mining algorithms.

Original languageEnglish
Title of host publication32nd International Conference on Scientific and Statistical Database Management, SSDBM 2020, Proceedings
EditorsElaheh Pourabbas, Dimitris Sacharidis, Kurt Stockinger, Thanasis Vergoulis
PublisherAssociation for Computing Machinery
ISBN (Electronic)9781450388146
DOIs
StatePublished - 7 Jul 2020
Event32nd International Conference on Scientific and Statistical Database Management, SSDBM 2020 - Virtual, Online, Austria
Duration: 7 Jul 20209 Jul 2020

Publication series

NameACM International Conference Proceeding Series

Conference

Conference32nd International Conference on Scientific and Statistical Database Management, SSDBM 2020
Country/TerritoryAustria
CityVirtual, Online
Period7/07/209/07/20

Keywords

  • Database Operators
  • Lambda Functions
  • SQL

Fingerprint

Dive into the research topics of 'Freedom for the SQL-Lambda: Just-in-Time-Compiling User-Injected Functions in PostgreSQL'. Together they form a unique fingerprint.

Cite this