Strategies for Expression Evaluation Using Sort-Merge Algorithms

Authors

  • Kim Skak Larsen

DOI:

https://doi.org/10.7146/dpb.v21i415.6728

Abstract

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.

Author Biography

Kim Skak Larsen

Downloads

Published

1992-09-01

How to Cite

Larsen, K. S. (1992). Strategies for Expression Evaluation Using Sort-Merge Algorithms. DAIMI Report Series, 21(415). https://doi.org/10.7146/dpb.v21i415.6728