Strategies for Expression Evaluation Using Sort-Merge Algorithms
DOI:
https://doi.org/10.7146/dpb.v21i415.6728Abstract
The sort-merge technique for evaluating relational algebra and calculus expressions was advocated very early and is a very widely used implementation technique. We present an algorithm for query analysis prior to execution with the aim of determining sort orders for every subexpression in such a way that resorting can be avoided during the actual evaluation. We prove that our algorithm will find such a solution, if one exists. In that case, we get the additional benefit of perfect pipelining, which implies that we do not have to save temporary results of evaluating subexpressions. The algorithm's running time is quadratic in the size of the expression.
In case no assignment of sort orders to subexpressions exists such that resorting can be avoided entirely, the aim is to find a minimum number of places to resort. We also consider this problem.
Downloads
Published
How to Cite
Issue
Section
License
Articles published in DAIMI PB are licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.