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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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.
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.
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.
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.
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.
A. Klug. On conjunctive queries containing inequalities. J. ACM, 35(1):146–160, 1988.
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.
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.
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.
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.
J. Ullman. Principles of Database and Knowledge-Base Systems, Vol. II: The New Technologies. Computer Science Press, New York (New York, USA), 1989.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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