Skip to main content

Algorithms for Rewriting Aggregate Queries Using Views

  • Conference paper
  • First Online:
Current Issues in Databases and Information Systems (ADBIS 2000, DASFAA 2000)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. 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. 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. 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. 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. 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. A. Klug. On conjunctive queries containing inequalities. J. ACM, 35(1):146–160, 1988.

    Article  MATH  MathSciNet  Google Scholar 

  7. 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. 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. 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. 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. 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 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Cohen, S., Nutt, W., Serebrenik, A. (2000). Algorithms for Rewriting Aggregate Queries Using Views. In: Štuller, J., Pokorný, J., Thalheim, B., Masunaga, Y. (eds) Current Issues in Databases and Information Systems. ADBIS DASFAA 2000 2000. Lecture Notes in Computer Science, vol 1884. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44472-6_6

Download citation

  • DOI: https://doi.org/10.1007/3-540-44472-6_6

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-67977-6

  • Online ISBN: 978-3-540-44472-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics