Database Execution Engine Query Plan Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database management systems face challenges in optimizing query execution performance due to complex queries and varying database types, leading to increased processing burdens and reduced response times.
Innovation Solution
A database execution engine that generates optimized query plans using pre-compiled and just-in-time compiled code, enabling pipelining and decoupling the application layer from the database layer to handle diverse database types efficiently.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If a database execution engine uses pre-compiled code for query execution, then query execution time is reduced and processing load is decreased, but the system loses flexibility in optimizing queries for different database types
Solution Approach 1:
The system dynamically selects between pre-compiled code and just-in-time compiled code based on the query type and database type. The query optimizer determines at runtime which code generation approach to use, allowing the system to adapt its behavior rather than being fixed to one method
Solution Approach 2:
The code generation approach changes as a parameter based on query characteristics. The system transitions between pre-compiled and just-in-time compiled modes by changing the compilation parameter, allowing optimization for different database types while maintaining fast execution paths
2Device complexity
If the database execution engine handles diverse database types with a single engine, then device complexity is reduced, but the difficulty of detecting and measuring optimal query plans increases
Solution Approach 1:
A single database execution engine is designed to handle multiple database types (relational, column-store, in-memory) through a universal query optimizer and code generator. The engine performs multiple functions by adapting its optimization strategies based on the detected database type, eliminating the need for separate execution engines for each database type
3Adaptability or versatility
If the system uses just-in-time code generation, then adaptability to different queries is improved, but processing time and computational resources increase
Solution Approach 1:
The system performs partial code generation (just-in-time compilation) only when necessary, rather than always using pre-compiled code or always generating code at runtime. The query optimizer analyzes the query characteristics and database type to determine the appropriate level of code generation, using pre-compiled code when possible and JIT compilation only when adaptation is required
Data Source
AI summary
In some aspects, there is provided a method for database query execution planning. In some aspects, a method may include receiving, at a database execution engine, a query; generating, by the database execution engine, a query algebra for the query, the query algebra optimized by a query optimizer at the database execution engine; generating, based on the optimized query algebra, a query plan for execution, the query plan including pre-compiled code and code generated just-in-time; and executing, by the database execution engine, at least part of the query plan including pre-compiled code and code generated just-in-time. Related systems, methods, and articles of manufacture are also described.


