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.
Keywords
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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsReferences
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
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
Greer, R.: Daytona and the fourth-generation language cymbal. Sigmod, 525–526 (1999). https://doi.org/10.1145/304181.304242
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
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
The LLVM Compiler Infrastructure. http://llvm.org/
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
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
Neumann, T., Leis, V.: Compiling database queries into machine code. IEEE Data Eng. Bull. 37(1), 3–11 (2014)
PostgresSQL Global Development Group. PostgresSQL. http://www.postgresql.org/
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
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)
TPC-H, an ad-hoc, decision support benchmark. Transaction Processing Performance Council. http://www.tpc.org/tpch
Wurthinger, T., Wob, A., Stadler, L., Duboscq, G., Simon, D., Wimmer, C.: Self-Optimizing AST Interpreters (2012)
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
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
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
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG
About this paper
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)