2014 · 24 citations · 18 references
ComputingComputer EngineeringComputer ScienceData ManagementDatabasesProgramming LanguagesDatabase ManagementQuery OptimizationQuery ProcessingStructured Query LanguageDatabase Management SystemsImperative TransformationSubquery OptimizationUser-defined Functions
Queries containing user-defined functions (UDFs) are widely used, since they allow queries to be written using a mix of imperative language constructs and SQL, thereby increasing the expressive power of SQL; further, they encourage modularity, and make queries easier to understand. However, not much attention has been paid to their optimization, except for simple UDFs without imperative constructs. Queries invoking UDFs with imperative constructs are executed using iterative invocation of the UDFs, leading to poor performance, especially if the UDF contains queries. Such poor execution has been a major deterrent to the wider usage of complex UDFs. In this paper we present a novel technique to decorrelate UDFs containing imperative constructs, allowing set-oriented execution of queries that invoke UDFs. Our technique allows imperative execution to be modeled using the Apply construct used earlier to model correlated subqueries, and enables transformation rules to be applied subsequently to decorrelate (or inline) UDF bodies. Subquery decorrelation was critical to the wide use of subqueries; our work brings the same benefits to queries that invoke complex UDFs. We have applied our techniques to UDFs running on two commercial database systems, and present results showing up to orders of magnitude improvement.
18
Christopher Olston, Benjamin Reed, Utkarsh Srivastava et al. · 2008 · 1.7K citations
On optimizing an SQL-like nested query
Won Bae Kim · ACM Transactions on Database Systems · 1982 · 393 citations · Full text
Optimization of nested SQL queries revisited
Richard A. Ganski, Harry K. T. Wong · 1987 · 177 citations · Full text
Praveen Seshadri, Hamid Pirahesh, T. Y. Cliff Leung · 2002 · 138 citations