| Date, C.J. An Introduction to Database Systems 4th Ed. Addison Wesley (1976). |
....are defined in our theory. Indeed comprehension notation, combined with recursive functions, has greater power than the relational calculus as it can express both recursion and computation [17] As a short example, consider Date s recursive bill of material query. The problem is stated as follows [7]. Given a relation: parts (main component, sub component, quantity) determine the set of all component and sub component parts of a given main part (to all levels) A solution using comprehensions is a recursive function explode with a single argument main, the main part: explode main = p j ....
....operations exported by Set are named t Set.collection, Set.empty, Set.single, Set. etc. The open declaration abbreviates these to t collection, empty, single, etc. Now we can write down set expressions such as: val primes = single 2 single 3 single 5 single 7; val odds = enum [1, 3, 5, 7, 9]; val evens = map succ odds; isin 5 primes Here primes, odds, and evens are of type int Set.collection. Finally, the following structure Relation implements binary relations. Note that we can reuse Set basis to generate the basic and derived operations on binary relations, viewed as sets. For ....
Date, C.J. An Introduction to Database Systems 4th Ed. Addison Wesley (1976).
....Secondly, the interaction with side effecting functions has already been described, and for the remainder of the paper we consider only pure, i.e. non side effecting, functions. Recursion An example illustrating just recursion is Date s bill of material query. The problem is stated as follows [10], given a relation: parts (main component, sub component, quantity) determine the set of all component and sub component parts of a given main part (to all levels) A solution using comprehensions is a recursive function explode with a single argument main, the main part: explode main = p j ....
....of a query can be transformed into a version that can be evaluated efficiently. An equivalent list comprehension transformation exists for each major conventional optimisation strategy [25] There are two classes of optimisation, or improvement, strategies algebraic and implementation based [10, 32]. Algebraic improvements are the result of transforming a query into a more efficient form using identities in the relational algebra. Implementation based improvements are obtained by using information about how the data is stored. This information might include the size of the relations and what ....
Date C.J. An Introduction to Database Systems 4th Ed. Addison Wesley (1976).
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC