JIT Query Processor Branch Loop Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database systems face performance bottlenecks in executing stored procedures due to prolonged processing times for branches and loops, limiting their ability to support real-time analysis and immediate decision-making.

Innovation Solution

A database system utilizing just-in-time (JIT) compilation optimizes stored procedure execution by optimizing branches and loops through specialized optimization rules, converting the execution plan into machine code, enabling parallel processing and reducing execution time.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If JIT compilation is applied to stored procedures, then execution performance is improved, but compilation time increases

Engineering Contradiction:
Improvestored procedure execution performanceVSAvoidcompilation time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system performs preliminary analysis of the SQL execution plan to identify branches and loops before JIT compilation. This pre-processing step prepares the control flow structure in advance, enabling more efficient compilation and reducing the overall compilation time while maintaining execution performance benefits.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The JIT compilation process is segmented into distinct phases: SQL execution plan generation, branch optimization, loop optimization, and final code generation. By dividing the compilation process into manageable segments, the system can optimize each phase independently and reduce total compilation time.

Inventive Principle:
Principle #1Segmentation

2Duration of action of moving object

If branches and loops are optimized in stored procedures, then execution time is reduced, but system complexity increases

Engineering Contradiction:
Improvestored procedure execution timeVSAvoidquery processor complexity
Core Design Contradiction:
Duration of action of moving objectVSDevice complexity

Solution Approach 1:

The system introduces an intermediate representation layer between the SQL execution plan and the optimized machine code. This intermediate layer captures the control flow structure (branches and loops) in a standardized format that can be systematically optimized without significantly complicating the overall system architecture.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The optimization process systematically transforms control flow parameters by identifying and modifying branch conditions and loop structures. By changing these parameters in a structured manner, the system reduces execution time while keeping the complexity management tractable through automated analysis and transformation rules.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If stored procedures are used to reduce SQL processing costs, then operational efficiency is improved, but execution time increases due to complex control flow

Engineering Contradiction:
Improveoperational efficiencyVSAvoidstored procedure execution time
Core Design Contradiction:
ProductivityVSDuration of action of moving object

Solution Approach 1:

The system replaces the traditional interpreter-based execution mechanism with a JIT-compiled machine code execution model. This substitution eliminates the overhead of interpretation for stored procedures with complex control flow, significantly reducing execution time while preserving the operational efficiency benefits of stored procedures.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The system dynamically adapts the execution approach by using JIT compilation to generate optimized code based on the specific control flow characteristics of each stored procedure. This dynamic approach allows the system to handle varying complexities of branches and loops efficiently, reducing execution time while maintaining operational efficiency.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS10754857B2Database system based on JIT compilation, query processing method thereof, and stored procedure optimization method thereof
Publication Date: 2020.08.25 ELECTRONICS & TELECOMM RES INST
  • US10754857B2 patent drawing
  • US10754857B2 patent drawing
  • US10754857B2 patent drawing

AI summary

A database system based on just-in-time (JIT) compilation performs a branch optimization and a loop optimization on the stored procedure. An interpreted query processor generating a structured query language (SQL) execution plan regarding an input online transaction processing (OLTP) query, an online analytical processing (OLAP) analysis, and a stored procedure. A JIT-based query processor receives the SQL execution plan, optimizes a branch and a loop in the received SQL execution plan, and then generates an optimized JIT execution plan. The JIT-based query processor generates a query processing executor performing query processing based on the JIT execution plan and provides a result of the query processing performed by the query processing executor.