MetaCart Sign in to MyCiteSeerX

Include Citations | Advanced Search | Help

Disambiguated Search | Include Citations | Advanced Search | Help

Comprehending Queries (1999) [1 citations — 0 self]

by Torsten Grust ,  Torsten Grust
Add To MetaCart

Abstract:

There are no compelling reasons why database-internal query representations have to be designated by operators. This text describes a world in which datatypes determine the comprehension of queries. In this world, a datatype is characterized by its algebra of value constructors. These algebras are principal. Query operators are secondary in the sense that they simply box (recursive) programs that describe how to form a query result by application of datatype constructors. Often, operators will be unboxed to inspect and possibly rewrite these programs. Query optimization then means to deal with the transformation of programs. The predominant role of the constructor algebras suggests that this model understands queries as mappings between such algebras. The key observation that makes the whole approach viable is that (a) homomorphic mappings are expressive enough to cover declarative user query languages like OQL or recent SQL dialects, and, at the same time, (b) a single program form suffices to express homomorphisms between constructor algebras. Reliance on a single combining form, catamorphisms, renders the query programs susceptible to Constructive Algorithmics, an effective and extensive algebraic theory of program transformations. The text then takes a step from catamorphisms towards a higher-level query representation based on the categorical notion of monads. In a nutshell, monads are algebras exhibiting exactly the structure that is needed to support the interpretation of a query calculus, the monad comprehension calculus. Built on top of the abstract monad notion, the calculus maps a variety of query constructs (e. g., bulk operations, aggregates, and quantifiers) to few syntactic forms. The uniformity of the calculus facilitates the analysis and transformation, especially the normalization, of its expressions. Few but generic calculus rewriting rules suffice to implement query transformations that would otherwise require extensive rule sets.

Citations

1122 Introduction to Functional Programming – Bird, Wadler - 1988
554 Notions of computation and monads – Moggi - 1991
479 The Implementation of Functional Programming Languages – Jones - 1987
385 Comprehending monads – WADLER - 1992
341 Deforestation: transforming programs to eliminate trees – Wadler - 1990
280 How to make ad-hoc polymorphism less ad-hoc – Wadler, Blott - 1989
224 Theorems for free – Wadler - 1989
103 Principles of programming with complex objects and collection types – Buneman, Naqvi, et al. - 1995
93 How to declare an imperative – WADLER - 1997
89 and Order in Algorithmics – Law - 1992
55 Comprehensions, a query notation for DBPLs – Trinder - 1991
54 Algebraic identities for program calculation – Bird - 1989
36 Querying Nested Collections – Wong - 1910
26 Improving list comprehension database queries – Trinder, Wadler - 1989
21 Efficient evaluation of aggregates on bulk types – Cluet, Moerkotte - 1995
17 Groupwise processing of relational queries – Chatziantoniou, Ross - 1997
14 Towards an Object-Oriented Query Algebra – Vance - 1992
12 Optimization of Nested Queries in a Complex Object Model – Steenhagen, Apers, et al. - 1994
4 How to comprehend queries functionally – Grust, Scholl - 1999
1 Data Structures and Program Transformation – Grant - 1990