In many data processing tasks, declarative query program- ming offers substantial benefit over manual data analysis: the query pro- cessors found in declarative systems can use powerful algorithms such as query planning to choose high-level execution strategies during compi- lation. However, the principal downside of such languages is that their primitives must be carefully curated, to allow the query planner to cor- rectly estimate their overhead. In this paper, we examine this challenge in one such system, PQL/Java. PQL/Java adds a powerful declarative query language to Java to enable and automatically parallelise queries over the Java heap. In the past, the language has not provided any sup- port for custom user-designed datatypes, as such support requires com- plex interactions with its query planner and backend. We examine PQL/Java and its intermediate language in detail and describe a new system that simplifies PQL/Java extensions. This sys- tem provides a language that permits users to add new primitives with arbitrary Java computations, and new rewriting rules for optimisation. Our system automatically stages compilation and exploits constant in- formation for dead code elimination and type specialisation. We have re-written our PQL/Java backend in our extension language, enabling dynamic and staged compilation. We demonstrate the effectiveness of our extension language in several case studies, including the efficient integration of SQL queries, and by analysing the run-time performance of our rewritten prototype backend.
['Hilmar Ackermann', 'Christoph Reichenbach', 'Christian Müller', 'Yannis Smaragdakis']
A Backend Extension Mechanism for PQL/Java with Free Run-Time Optimisation