Algorithms for Rewriting Aggregate Queries Using Views

  • Sara Cohen
  • Werner Nutt
  • Alexander Serebrenik
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1884)

Abstract

Queries involving aggregation are typical in database applications. One of the main ideas to optimize the execution of an aggregate query is to reuse results of previously answered queries. This leads to the problem of rewriting aggregate queries using views. Due to a lack of theory, algorithms for this problem were rather ad-hoc. They were sound, but were not proven to be complete.

Recently we have given syntactic characterizations for the equivalence of aggregate queries and applied them to decide when there exist rewritings. However, these decision procedures do not lend themselves immediately to an implementation. In this paper, we present practical algorithms for rewriting queries with count and sum. Our algorithms are sound. They are also complete for important cases. Our techniques can be used to improve well-known procedures for rewriting non-aggregate queries. These procedures can then be adapted to obtain algorithms for rewriting queries with min and max. The algorithms presented are a basis for realizing optimizers that rewrite queries using views.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Sara Cohen
    • 1
  • Werner Nutt
    • 2
  • Alexander Serebrenik
    • 3
  1. 1.Computer Science Dept.The Hebrew UniversityJerusalemIsrael
  2. 2.German Research Center for Artificial IntelligenceSaarbrückenGermany
  3. 3.Computer Science Dept.HeverleeBelgium

Personalised recommendations