Adaptive Query Compilation in Graph Databases

Compiling database queries into compact and efficient machine code has proven to be a great technique to improve query performance and to exploit characteristics of modern hardware. Furthermore, compilation frameworks like LLVM provide powerful optimization techniques and support different backends. However, the time for generating machine code becomes an issue for short-running queries or queries which could produce early results quickly. In this work, we present an adaptive approach integrating graph query interpretation and compilation. While query compilation and code generation are running in the background, the query execution starts using the interpreter. As soon as the code generation is finished, the execution switches to the compiled code. Our evaluation shows that autonomously switching execution modes helps to hide compilation times.

[1]  Viktor Leis,et al.  Morsel-driven parallelism: a NUMA-aware query evaluation framework for the many-core age , 2014, SIGMOD Conference.

[2]  Tiark Rompf,et al.  How to Architect a Query Compiler, Revisited , 2018, SIGMOD Conference.

[3]  Ralph E. Johnson,et al.  Design Patterns: Abstraction and Reuse of Object-Oriented Design , 1993, ECOOP.

[4]  Victor Lee,et al.  TigerGraph: A Native MPP Graph Database , 2019, ArXiv.

[5]  Amir Shaikhha,et al.  Push vs. Pull-Based Loop Fusion in Query Engines , 2016, ArXiv.

[6]  Samuel Madden,et al.  Voodoo - A Vector Algebra for Portable Database Performance on Modern Hardware , 2016, Proc. VLDB Endow..

[7]  Craig Freedman,et al.  Compilation in the Microsoft SQL Server Hekaton Engine , 2014, IEEE Data Eng. Bull..

[8]  Jens Teubner,et al.  Efficient generation of machine code for query compilers , 2020, DaMoN.

[9]  John Cocke,et al.  Register Allocation Via Coloring , 1981, Comput. Lang..

[10]  Alexander Baumstark,et al.  JIT happens: Transactional Graph Processing in Persistent Memory meets Just-In-Time Compilation , 2021, EDBT.

[11]  Viktor Leis,et al.  Adaptive Execution of Compiled Queries , 2018, 2018 IEEE 34th International Conference on Data Engineering (ICDE).

[12]  Amir Shaikhha,et al.  How to Architect a Query Compiler , 2016, SIGMOD Conference.

[13]  Viktor Leis,et al.  Everything You Always Wanted to Know About Compiled and Vectorized Queries But Were Afraid to Ask , 2018, Proc. VLDB Endow..

[14]  Viktor Leis,et al.  Compiling Database Queries into Machine Code , 2014, IEEE Data Eng. Bull..

[15]  Michael Grossniklaus,et al.  An Algebra and Equivalences to Transform Graph Patterns in Neo4j , 2016, EDBT/ICDT Workshops.