Loading...
Please wait, while we are loading the content...
Similar Documents
Translating and Optimizing SQL Queries Having Aggregates
| Content Provider | Semantic Scholar |
|---|---|
| Author | Biiltzingsloewen, Giinter Von |
| Copyright Year | 1987 |
| Abstract | is at least ae powerful as SQL. Two well known relational query languages that have a sound theoretical foundation are relational algebra and relational calculus. As SQL is more closely related to relational calculus, we define the semantics of SQL by translation into calculus. However, relational calculus has to be extended in order to deal with aggregate functions and null values. The op timiation of SQL queries is thus reduced to the optimiaation of relational calculus queries, which makes the following results also applicable to other query languages based on relational calculus (e.g. QUEL). In this paper, we give a precise definition of the semantics of SQL queries having aggregate functions, identify the problems associated with the optimisation of such queries and give some solutions. The semantics of SQL queries is defined by translating them into expressions of an extended relational calculus (extensions are necessary for a correct treatment of aggregate functions and null values). The discussion of the optimization problems is based on a new transformation of a relational calculus expression into relational algebra. By investigating the transformation of aggregate functions we are able to identify two major problems: correct integration of the values of aggregate functions applied to empty relations and unnecessary computation of unneeded function values. To solve these problems we propose to interpret an aggregate function applied to a calculus expression with some free variables as a function on the attributes of these variables that are referenced in the expression. Doing so, we are able to develop several new processing strategies that should be considered by an optimiser. |
| File Format | PDF HTM / HTML |
| Alternate Webpage(s) | http://www.vldb.org/conf/1987/P235.PDF |
| Language | English |
| Access Restriction | Open |
| Content Type | Text |
| Resource Type | Article |