Skip to main content

Runtime Specialization of PostgreSQL Query Executor

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 10742))

Abstract

For computationally intensive workloads, achieving high database performance is in direct correspondence to utilizing CPU efficiently. At the same time, interpretation overhead inherent to traditional interpretive SQL engines gets in the way of optimal CPU utilization.

One solution to this problem is dynamic query compilation, which consists in generating efficient machine code at run time given a particular input query.

Creating a complete query compiler from scratch for an existing database system takes a large amount of development and maintenance effort. Similar results, however, can be obtained more easily using program specialization of a generic query engine with respect to a particular query.

This paper presents intermediate results of applying this approach to the query engine at the core of PostgreSQL database system.

This work is supported by RFBR grant 17-07-00759 A.

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

Buying options

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 EPUB and 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

Learn about institutional subscriptions

References

  1. Chamberlin, D.D., Putzolu, F., Selinger, P.G., Schkolnick, M., Slutz, D.R., Traiger, I.L., Yost, R.A.: A history and evaluation of System R. Commun. ACM 24(10), 632–646 (1981). https://doi.org/10.1145/358769.358784

    Article  Google Scholar 

  2. Graefe, G.: Volcano - an extensible and parallel query evaluation system. IEEE Trans. Knowl. Data Eng. 6(1), 120–135 (1994). https://doi.org/10.1109/69.273032

    Article  Google Scholar 

  3. Greer, R.: Daytona and the fourth-generation language cymbal. Sigmod, 525–526 (1999). https://doi.org/10.1145/304181.304242

  4. Krikellas, K., Viglas, S.D., Cintra, M.: Generating code for holistic query evaluation. In: Proceedings of International Conference on Data Engineering, pp. 613–624 (2010). https://doi.org/10.1109/ICDE.2010.5447892

  5. Lomuller, V., Charles, H.-P.: A LLVM extension for the generation of low overhead runtime program specializer. In: Proceedings of International Workshop on Adaptive Self-Tuning Computing Systems - ADAPT 2014, pp. 14–16 (2014). https://doi.org/10.1145/2553062.2553064

  6. The LLVM Compiler Infrastructure. http://llvm.org/

  7. Melnik, D., Buchatskiy, R., Zhuykov, R., Sharygin, E.: JIT-compiling SQL queries in PostgreSQL using LLVM. Presented at PGCon 2017 (2017). http://www.pgcon.org/2017/schedule/events/1092.en.html

  8. Neumann, T.: Efficiently compiling efficient query plans for modern hardware. Proc. VLDB Endow. 4(9), 539–550 (2011). https://doi.org/10.14778/2002938.2002940

    Article  Google Scholar 

  9. Neumann, T., Leis, V.: Compiling database queries into machine code. IEEE Data Eng. Bull. 37(1), 3–11 (2014)

    Google Scholar 

  10. PostgresSQL Global Development Group. PostgresSQL. http://www.postgresql.org/

  11. Rompf, T., Odersky, M.: Lightweight modular staging. In: Proceedings of the Ninth International Conference on Generative Programming and Component Engineering - GPCE 2010, p. 127 (2010). https://doi.org/10.1145/1868294.1868314

  12. Smowton, C.S.F.: I/O Optimisation and elimination via partial evaluation. University of Cambridge, Computer Laboratory, Ph.D. thesis, (UCAM-CL-TR-865), 1131 (2014)

    Google Scholar 

  13. TPC-H, an ad-hoc, decision support benchmark. Transaction Processing Performance Council. http://www.tpc.org/tpch

  14. Wurthinger, T., Wob, A., Stadler, L., Duboscq, G., Simon, D., Wimmer, C.: Self-Optimizing AST Interpreters (2012)

    Google Scholar 

  15. Zhang, R., Debray, S., Snodgrass, R.T.: Micro-specialization: dynamic code specialization of database management systems. In: International Symposium on Code 6373 (2012). https://doi.org/10.1145/2259016.2259025

  16. Zhang, R., Snodgrass, R.T., Debray, S.: Micro-specialization in DBMSes. In: Proceedings - International Conference on Data Engineering, pp. 690–701 (2012). https://doi.org/10.1109/ICDE.2012.110

  17. Zhang, R., Snodgrass, R.T., Debray, S.: Application of micro-specialization to query evaluation operators. In: Proceedings - 2012 IEEE 28th International Conference on Data Engineering Workshops, ICDEW 2012, pp. 315–321 (2012). https://doi.org/10.1109/ICDEW.2012.43

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Eugene Sharygin .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Sharygin, E., Buchatskiy, R., Zhuykov, R., Sher, A. (2018). Runtime Specialization of PostgreSQL Query Executor. In: Petrenko, A., Voronkov, A. (eds) Perspectives of System Informatics. PSI 2017. Lecture Notes in Computer Science(), vol 10742. Springer, Cham. https://doi.org/10.1007/978-3-319-74313-4_27

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-74313-4_27

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-74312-7

  • Online ISBN: 978-3-319-74313-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics