SQL database systems support user-defined functions (UDFs), but they
hardly encourage *programming* with these functions. Quite the
contrary: the invocation and evaluation of SQL UDFs as well as the
interpretation of imperative PL/SQL code comes with a significant
runtime tax that renders complex computation close to the data largely
impractical. Indeed, it is established developer lore that “serious
computation” is better performed outside the RDBMS in languages other
than SQL or PL/SQL.
It doesn't have to be this way and we do not have turn RDBMSs on their
head to improve the dire situation. We describe SQL-level, non-invasive
transformations that turn recursive SQL UDFs and complex PL/SQL
procedures with arbitrarily complex control flow into plain SQL
constructs that contemporary RDBMSs can evaluate way more efficiently.
These transformations bank on techniques established by the functional
programming language community--here, we twist them to the RDBMSs' (and
our) advantage. RDBMSs can indeed make for expressive and declaratively
programmable runtime systems. Let us use them as such!
Please email for a
Zoom link