Skip to main content

Fighting Redundancy in SQL

  • Conference paper
Data Warehousing and Knowledge Discovery (DaWaK 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2737))

Included in the following conference series:

  • 436 Accesses

Abstract

Many SQL queries with aggregated subqueries exhibit redundancy (overlap in FROM and WHERE clauses). We propose a method, called the for-loop, to optimize such queries by ensuring that redundant computations are done only once. We specify a procedure to build a query plan implementing our method, give an example of its use and argue that it offers performance advantages over traditional approaches.

This research was sponsored by NSF under grant IIS-0091928.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

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.

References

  1. Badia, A., Niehues, M.: Optimization of sequences of relational queries in decision-support environments. In: Mohania, M., Tjoa, A.M. (eds.) DaWaK 1999. LNCS, vol. 1676, pp. 126–131. Springer, Heidelberg (1999)

    Google Scholar 

  2. Cao, B., Badia, A.: Subquery Rewriting for Optimization of SQL Queries (submitted for publication)

    Google Scholar 

  3. Dayal, U.: Of Nests and Trees: A Unified Approach to Processing Queries That Contain Nested Subqueries, Aggregates, and Quantifiers. In: Proceedings of the VLDB Conference (1987)

    Google Scholar 

  4. Fegaras, L., Maier, D.: Optimizing Queries Using an Effective Calculus. ACM TODS 25(4) (2000)

    Google Scholar 

  5. Freytag, J., Goodman, N.: On the Translation of Relational Queries into Iterative Programs. ACM Transactions on Database Systems 14(1) (March 1989)

    Google Scholar 

  6. Ganski, R., Wong, H.: Optimization of Nested SQL Queries Revisited. In: Proceedings of the ACM SIGMOD Conference (1987)

    Google Scholar 

  7. Goel, P., Iyer, B.: SQL Query Optimization: Reordering for a General Class of Queries. In: Proceedings of the 1996 ACM SIGMOD Conference (1996)

    Google Scholar 

  8. Kim, W.: On Optimizing an SQL-Like Nested Query. ACM Transactions On Database Systems 7(3) (September 1982)

    Google Scholar 

  9. Lieuwen, D., DeWitt, D.: A Transformation-Based Approach to Optimizing Loops in database Programming Languages. In: Proceedings of the ACM SIGMOD Conference (1992)

    Google Scholar 

  10. Lu, H., Chan, H.C., Wei, K.K.: A Survey on Usage of SQL. SIGMOD Record (1993)

    Google Scholar 

  11. Muralikrishna, M.: Improving Unnesting Algorithms for Join Aggregate Queries in SQL. In: Proceedings of the VLDB Conference (1992)

    Google Scholar 

  12. Park, J., Segev, A.: Using common subexpressions to optimize multiple queries. In: Proceedings of the 1988 IEEE CS ICDE (1988)

    Google Scholar 

  13. Ross, K., Rao, J.: Reusing Invariants: A New Strategy for Correlated Queries. In: Proceedings of the ACM SIGMOD Conference (1998)

    Google Scholar 

  14. Rao, J., Lindsay, B., Lohman, G., Pirahesh, H., Simmen, D.: Using EELs, a Practical Approach to Outerjoin and Antijoin Reordering. In: Proceedings of ICDE (2001)

    Google Scholar 

  15. Seshadri, P., Pirahesh, H., Cliff Leung, T.Y.: Complex Query Decorrelation. In: Proceedings of ICDE (1996)

    Google Scholar 

  16. Seshadri, P., Hellerstein, J.M., Pirahesh, H., Cliff Leung, T.Y., Ramakrishnan, R., Srivastava, D., Stuckey, P.J., Sudarshan, S.: Cost-Based Optimization for Magic: Algebra and Implementation. In: Proceedings of the SIGMOD Conference (1996)

    Google Scholar 

  17. Mumick, I.S., Pirahesh, H.: Implementation of Magic-sets in a Relational Database System. In: Proceedings of the SIGMOD Conference (1994)

    Google Scholar 

  18. TPC-H Benchmark, TPC Council, http://www.tpc.org/home.page.html

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Badia, A., Anand, D. (2003). Fighting Redundancy in SQL. In: Kambayashi, Y., Mohania, M., Wöß, W. (eds) Data Warehousing and Knowledge Discovery. DaWaK 2003. Lecture Notes in Computer Science, vol 2737. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45228-7_40

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-45228-7_40

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-40807-9

  • Online ISBN: 978-3-540-45228-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics