DocumentCode :
1241478
Title :
Optimization of Linear Recursive Queries in SQL
Author :
Ordonez, Carlos
Author_Institution :
Dept. of Comput. Sci., Univ. of Houston, Houston, TX, USA
Volume :
22
Issue :
2
fYear :
2010
Firstpage :
264
Lastpage :
277
Abstract :
Recursion is a fundamental computation mechanism which has been incorporated into the SQL language. This work focuses on the optimization of linear recursive queries in SQL. Query optimization is studied with two important graph problems: computing the transitive closure of a graph and getting the power matrix of its adjacency matrix. We present SQL implementations for two fundamental algorithms: seminaive and direct. Five query optimizations are studied: 1) storage and indexing; 2) early selection; 3) early evaluation of nonrecursive joins; 4) pushing duplicate elimination; and 5) pushing aggregation. Experiments compare both evaluation algorithms and systematically evaluate the impact of optimizations with large input tables. Optimizations are evaluated on four types of graphs: binary trees, lists, cyclic graphs, and complete graphs, going from the best to worst case. In general, Seminaive is faster than direct, except for complete graphs. Storing and indexing rows by vertex and pushing aggregation work well on trees, lists, and cyclic graphs. Pushing duplicate elimination is essential for complete graphs, but slows computation for acyclic graphs. Early selection with equality predicates significantly accelerates computation for all types of graphs.
Keywords :
SQL; graph theory; query processing; relational databases; SQL language; adjacency matrix; binary trees; complete graphs; computation mechanism; cyclic graphs; early selection; equality predicates; graph problems; linear recursive queries; lists graphs; power matrix; pushing duplicate elimination; query optimizations; relational DBMS; seminaive algorithms; Recursive query; SQL; query optimization; transitive closure.;
fLanguage :
English
Journal_Title :
Knowledge and Data Engineering, IEEE Transactions on
Publisher :
ieee
ISSN :
1041-4347
Type :
jour
DOI :
10.1109/TKDE.2009.83
Filename :
4815244
Link To Document :
بازگشت