Low complexity aggregation in GraphLog and Datalog

  • Authors:
  • Mariano P. Consens;Alberto O. Mendelzon

  • Affiliations:
  • -;-

  • Venue:
  • ICDT '90 Proceedings of the third international conference on database theory on Database theory
  • Year:
  • 1990

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present facilities for computing aggregate functions over sets of tuples and along paths in a database graph.We show how Datalog can be extended to compute a large class of queries with aggregates without incurring the large expense of a language with general set manipulation capabilities. In particular, we aim for queries that can be executed efficiently in parallel, using the class NC and its various subclasses as formal models of low parallel complexity.Our approach retains the standard relational notion of relations as sets of tuples, not requiring the introduction of multisets. For the case where no rules are recursive, the language is exactly as expressive as Klug's first order language with aggregates. We show that this class of non-recursive programs cannot express transitive closure (unless LOGSPACE=NLOGSPACE), thus providing evidence for a widely believed but never proven folk result. We also study the expressive power and complexity of languages that support aggregation over recursion.We then describe how these facilities, as well as manipulating the length of paths in database graphs, are incorporated into our visual query language GraphLog. While GraphLog could easily be extended to handle all the queries described above, we prefer to restrict the language in a natural way to avoid explicit recursion; all recursion is expressed as transitive closure. We show that this guarantees all expressible queries are in NC. We analyze other proposals and show that they can express queries that are logspace-complete for P and thus unlikely to be parallelizable efficiently.