Database Execution Engine Query Plan Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvequery execution timeVSAvoidflexibility in optimizing queries
Core Design Contradiction:
Loss of timeVSAdaptability or versatility

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

Inventive Principle:
Principle #15Dynamics

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

Inventive Principle:
Principle #35Parameter changes

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

Engineering Contradiction:
Improvenumber of execution enginesVSAvoiddetecting optimal query plans
Core Design Contradiction:
Device complexityVSDifficulty of detecting and measuring

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

Inventive Principle:
Principle #6Universality (Multi-functionality)

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

Engineering Contradiction:
Improveadaptability to different queriesVSAvoidprocessing time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

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

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS11016973B2Query plan execution engine
Publication Date: 2021.05.25 SAP SE
  • US11016973B2 patent drawing
  • US11016973B2 patent drawing
  • US11016973B2 patent drawing

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.