Abstract
We address the problem of evaluating a recursively defined relation. We are given an equation of the form:
where f is a monotonie relational algebra expression and we want to evaluate the least fixpoint of that equation. We first recall that there is a simple naive evaluation of this solution and we argue that its performance is poor because it generates duplicate computations.
To solve this problem of duplication, we define a simple differential calculus on relational expressions. The goal is to see how a relational expression of the form f(R) increases when R is replaced by R+dR. The differential is thus defined as f(R+dR) - f(R). We give simple rules to compute the differential of relational expressions, using join, composition, union, intersection, projection, and selection. We also give optimized expressions for the differential when specific conditions, such as functional dependencies, hold. Finally, we show how the differential of an expression can be used to produce an “optimal” evaluation of a least fixpoint. This is done (i) by giving a logic-based definition of performance, and (ii) demonstrating a relational algebra program that computes the least fixpoint of a recursive equation and showing some optimal properties of that relational algebra program.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aho, A., J. Ullman, “Universality of Data Retrieval Languages”, Sixth ACM Symposium on Principles of Programming Languages, 1979.
Chandra, A. and Harel, D., “Computable Queries for Relational Data Bases”, JCSS 21, 156–178, 1980.
Chandra, A. and Harel, D., “Horn Clauses and the Fixpoint Query Hierarchy”, Proceedings First PODS, 1982.
Chandra, A. and Harel, D., “Structure and Complexity of Relational Queries”, JCSS 25, 99–128, 1982.
Chang, C., “On the Evaluation of Queries Containing Derived Relations in Relational Database”, in Advances in Data Base Theory Vol.1. H.Gallaire, J. Minker and J.M. Nicolas (eds.), Plenum Press, New York, pp 235–260, 1981.
Henschen, L. J. and S. A. Naqvi, “On compiling queries in recursive first-order databases”, J. ACM, Vol. 31, No. 1, pp. 47–85, January, 1984.
McLeod, D. and J.M.Smith. “Abstraction in Databases”, Proc. of Workshop on Data Abstraction, Databases and Conceptual Modelling, M.L. Brodie and S. Zilles (eds.), ACM SIGMOD Record Vol.11, No.2, January 1981.
Naqvi, S., “Interfacing Prolog and Relational Databases: The Problem of Recursive Queries”, Proceedings 1st International Workshop on Expert Database Systems, Kiawha, October 1984.
Naqvi, S. and Henschen, L., “Synthesizing Least Fixed Point Queries into Non-recursive Iterative Programs”, Proceedings IJCAI 83, Karlsruhe, 1983.
Ullman, J. D., Principles of Database Systems, Computer Science Press, Rockville, Md., 1982.
Ullman, J., “Implementation of Logical Query Languages for Databases”, ACM Transactions on Database Systems, Vol. 10., No. 3, pp. 289–321, 1985
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1986 Springer-Verlag New York Inc.
About this chapter
Cite this chapter
Bancilhon, F. (1986). Naive Evaluation of Recursively Defined Relations. In: Brodie, M.L., Mylopoulos, J. (eds) On Knowledge Base Management Systems. Topics in Information Systems. Springer, New York, NY. https://doi.org/10.1007/978-1-4612-4980-1_17
Download citation
DOI: https://doi.org/10.1007/978-1-4612-4980-1_17
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4612-9383-5
Online ISBN: 978-1-4612-4980-1
eBook Packages: Springer Book Archive