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.

References

  1. CNS99.
    S. Cohen, W. Nutt, and A. Serebrenik. Rewriting aggregate queries using views. In Ch. Papadimitriou, editor, Proc. 18(suth) Symposium on Principles of Database Systems, Philadelphia (Pennsylvania, USA), May 1999. ACM Press.Google Scholar
  2. CNS00.
    S. Cohen, W. Nutt, and A. Serebrenik. Algorithms for rewriting aggregate queries using views. Technical Report CW292, Departement Computerwetenschappen, K.U.Leuven, Leuven, Belgium, 2000. Available at http://www.cs.kuleuven.ac.be/publicaties/rapporten/CW2000.html.Google Scholar
  3. CV93.
    S. Chaudhuri and M. Vardi. Optimization of real conjunctive queries. In Proc. 12(suth) Symposium on Principles of Database Systems, Washington (D.C., USA), May 1993. ACM Press.Google Scholar
  4. GHQ95.
    A. Gupta, V. Harinarayan, and D. Quass. Aggregate query processing in data warehouses. In Proc. 21(sust) International Conference on Very Large Data Bases. Morgan Kaufmann Publishers, August 1995.Google Scholar
  5. HRU96.
    V. Harinarayan, A. Rajaraman, and J. Ullman. Implementing data cubes efficiently. In Proc. 1996 ACM SIGMOD International Conference on Management of Data, pages 205–227, Montreal (Canada), June 1996.Google Scholar
  6. Klu88.
    A. Klug. On conjunctive queries containing inequalities. J. ACM, 35(1):146–160, 1988.MATHCrossRefMathSciNetGoogle Scholar
  7. LMSS95.
    A.Y. Levy, A.O. Mendelzon, Y. Sagiv, and D. Srivastava. Answering queries using views. In Proc. 14(suth) Symposium on Principles of Database Systems, pages 95–104, San Jose (California, USA), May 1995. ACM Press.Google Scholar
  8. LRO96.
    A.Y. Levy, A. Rajaraman, and J. Ordille. Querying heterogeneous information sources using source description. In Proc. 22nd International Conference on Very Large Data Bases, Bombay (India), September 1996. Morgan Kaufmann Publishers.Google Scholar
  9. NSS98.
    W. Nutt, Y. Sagiv, and S. Shurin. Deciding equivalences among aggregate queries. In J. Paredaens, editor, Proc. 17(suth) Symposium on Principles of Database Systems, pages 214–223, Seattle (Washington, USA), June 1998. ACM Press. Long version as Report of Esprit LTR DWQ.Google Scholar
  10. SDJL96.
    D. Srivastava, Sh. Dar, H.V. Jagadish, and A.Y. Levy. Answering queries with aggregation using views. In Proc. 22(sund) International Conference on Very Large Data Bases, Bombay (India), September 1996. Morgan Kaufmann Publishers.Google Scholar
  11. Ull89.
    J. Ullman. Principles of Database and Knowledge-Base Systems, Vol. II: The New Technologies. Computer Science Press, New York (New York, USA), 1989.Google Scholar

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