skip to main content
10.1145/3299869.3324960acmconferencesArticle/Chapter ViewAbstractPublication PagesmodConference Proceedingsconference-collections
research-article

Iterative Query Processing based on Unified Optimization Techniques

Published:25 June 2019Publication History

ABSTRACT

Hybrid transactional and analytical processing (HTAP) systems like SAP HANA make it much simpler to manage both operational load and analytical queries without ETL, separate data warehouses, et al. To represent both transactional and analytical business logic in a single database system, stored procedures are often used to express analytical queries using control flow logic and DMLs. Optimizing these complex procedures requires a fair knowledge of imperative programming languages as well as the declarative query language. Therefore, unified optimization techniques considering both program and query optimization techniques are essential for achieving optimal query performance. In this paper, we propose a novel unified optimization technique for efficient iterative query processing. We present a notion of query motion that allows the movement of SQL queries in and out of a loop. Additionally, we exploit a new cost model that measures the quality of the execution plan with consideration for queries and loop iterations. We describe our experimental evaluation that demonstrates the benefit of our technique using both a standard decision support benchmark and real-world workloads. An extensive evaluation shows that our unified optimization technique enumerates plans that achieve performance improvements of up to an order of magnitude faster than plans generated by the existing loop-invariant code motion technique.

References

  1. A. V. Aho, S. L. Monica, R. Sethi, and J. D. Ullman. 2007. Compilers: Principles, techniques, and tools(2nd ed.). Addison-wesley.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. De Alba and D. Kaeli. 2002. Path-based hardware loop prediction. In CICINDI conference.Google ScholarGoogle Scholar
  3. C. Binnig, N. May, and T. Mindnich. 2013. SQLScript: Efficiently analyzing big enterprise data in SAP HANA. BTW(2013), 363--382.Google ScholarGoogle Scholar
  4. M. Boehm, D. R. Burdick, A. V. Evfimievski, B. Reinwald, F. R. Reiss, P. Sen, S. Tatikonda, and Y. Tian. 2014. SystemML's Optimizer: Plan generation for large-scale machine learning programs. IEEE Data Eng.Bull.37, 3 (2014), 52--62.Google ScholarGoogle Scholar
  5. A. Cheung, S. Madden, and A. Solar-Lezama. 2014. Sloth: Being lazy is a virtue (when issuing database queries). In SIGMOD conference. ACM,931--942.Google ScholarGoogle Scholar
  6. A. Cheung, A. Solar-Lezama, and S. Madden. 2012. Inferring SQL queries using program synthesis. CoRRabs/1208.2013 (2012).Google ScholarGoogle Scholar
  7. K. Cooper and L. Torczon. 2011. Engineering a compiler (2nd ed.). Elsevier. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. 1991. Efficiently computing static single assignment form and the control dependence graph. ACM TOPLAS 13, 4 (1991), 451--490. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. R. de Alba and D. R. Kaeli. 2001. Runtime predict ability of loops. In International Workshop on Workload Characterization. IEEE, 91--98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Diaconu, C. Freedman, E. Ismert, P. Larson, P. Mittal, R. Stonecipher, N. Verma, and M. Zwilling. 2013. Hekaton: SQL server's memory-optimized OLTP engine. In SIGMOD Conference. ACM, 1243--1254. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. El-Helw, V. Raghavan, M. A. Soliman, G. Caragea, Z. Gu, and M.Petropoulos. 2015. Optimization of common table expressions in MPP database systems. In VLDB conference. 1704--1715. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. K. V. Emani, K. Ramachandra, S. Bhattacharya, and S. Sudarshan. 2016. Extracting equivalent SQL from imperative code in database applications. In SIGMOD conference. ACM, 1781--1796. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Galindo-Legaria and M. Joshi. 2001. Orthogonal optimization of subqueries and aggregation. In SIGMOD conference. ACM, 571--581.Google ScholarGoogle Scholar
  14. F. Gulyassy, M. Hoppe, and M. Iermann. 2010. Materials planning with SAP. Galileo Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Guravannavar and S. Sudarshan. 2008. Rewriting procedures for batched bindings. In VLDB conference. 1107--1123.Google ScholarGoogle Scholar
  16. Y. Klonatos, C. Koch, T. Rompf, and H. Chafi. 2014. Building efficient query engines in a high-level language. In VLDB conference. 853--864. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Lattner and V. Adve. 2004. LLVM: A compilation framework for lifelong program analysis & transformation. In CGO conference. IEEE Computer Society, 75. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. F. Lieuwen and D. J. DeWitt. 1992. A transformation-based approach to optimizing loops in database programming languages. In SIGMOD conference. ACM, 91--100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. I. Mami and Z. Bellahsene. 2012. A survey of view selection methods. In SIGMOD conference. ACM, 20--29.Google ScholarGoogle Scholar
  20. J. Meehan, N. Tatbul, S. Zdonik, C. Aslantas, U. Cetintemel, J. Du, T. Kraska, S. Madden, D. Maier, A. Pavlo, M. Stonebraker, K. Tufte, and H. Wang. 2015. S-Store: Streaming meets transaction processing. In VLDB conference. 2134--2145. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. S. S. Muchnick. 1997. Advanced compiler design and implementation. Morgan Kaufmann. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. T. Neumann. 2011. Efficiently compiling efficient query plans formodern hardware. In VLDB conference. 539--550. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Onizuka, H. Kato, S. Hidaka, K. Nakano, and Z. Hu. 2013. Optimization for iterative queries on MapReduce. In VLDB conference. 241--252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. Palkar, J. J. Thomas, A. Shanbhag, D. Narayanan, H. Pirk, M.Schwarzkopf, S. Amarasinghe, and M. Zaharia. 2017. Weld: A common runtime for high performance data analytics. In CIDR conference.Google ScholarGoogle Scholar
  25. K. Ramachandra, R. Guravannavar, and S. Sudarshan. 2012. Program analysis and transformation for holistic optimization of database applications. In SIGPLAN International Workshop on State of the Art in Java Program analysis (SOAP). ACM, 39--44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. K. Ramachandra, K. Park, K. V. Emani, A. Halverson, C. Galindo-Legaria, and C. Cunningham. 2017. Froid: Optimization of imperative programs in a relational database. In VLDB conference. 432--444. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. A. Shaikhha, Y. Klonatos, L. Parreaux, L. Brown, M. Dashti, and C.Koch. 2016. How to architect a query compiler. In SIGMOD conference. ACM, 1907--1922. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. Tetzlaff and S. Glesner. 2013. Static prediction of loop iterationcounts using machine learning to enable hot spot optimizations. In Euromicro SEAA conference. IEEE, 300--307. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. TPC 2015. TPC-DS Version 2.1.0. http://www.tpc.org/tpcds/Google ScholarGoogle Scholar
  30. X. Yan and J. Han. 2002. gspan: Graph-based substructure pattern mining. In ICDM conference. IEEE, 721--724 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Iterative Query Processing based on Unified Optimization Techniques

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      SIGMOD '19: Proceedings of the 2019 International Conference on Management of Data
      June 2019
      2106 pages
      ISBN:9781450356435
      DOI:10.1145/3299869

      Copyright © 2019 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 June 2019

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      SIGMOD '19 Paper Acceptance Rate88of430submissions,20%Overall Acceptance Rate785of4,003submissions,20%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader