Unified Query Optimization via Hoist and Sink Operations

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current optimization strategies for database query processing are inadequate in managing the increasing demand on computing resources, particularly in scenarios involving both query statements and imperative constructs like loops, where existing techniques fail to fully optimize resource utilization.

Innovation Solution

A novel optimization strategy that involves receiving an intermediate representation of a procedure containing query and imperative statements, performing hoist and sink operations to relocate query statements within the procedure, and estimating computing resource demands to determine an optimal execution plan that minimizes resource usage.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional query optimization strategies are used, then query execution can be optimized using indexes and JOIN ordering, but the increasing demand on computing resources cannot be fully managed

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidcomputing resource demand
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The patent applies dynamics by making the query execution plan adaptive through iterative optimization. The system dynamically adjusts query statements based on execution feedback and resource consumption patterns, transforming static optimization into a dynamic process that responds to actual computing resource demands and performance characteristics.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes key parameters of query execution including statement placement, iteration counts, and execution ordering. By systematically varying these parameters across multiple execution plans and selecting the optimal one, the system achieves better resource utilization while maintaining query efficiency.

Inventive Principle:
Principle #35Parameter changes

2Device complexity

If query statements are executed outside loops, then query optimization is simpler, but query inlining combines multiple queries increasing execution plan complexity

Engineering Contradiction:
Improveexecution plan structureVSAvoidcomputing execution resource demand
Core Design Contradiction:
Device complexityVSProductivity

Solution Approach 1:

The patent merges multiple query statements into a single inlined query when executing within loops. This combining approach reduces the total number of separate query executions, thereby decreasing computing execution resource demand while the optimization system manages the resulting execution plan complexity through systematic search and selection methods.

Inventive Principle:
Principle #5Merging (Combining)

3Use of energy by moving object

If more query statements are inlined, then execution resource demand decreases, but the optimization process becomes more complex

Engineering Contradiction:
Improvecomputing execution resource demandVSAvoidoptimization process complexity
Core Design Contradiction:
Use of energy by moving objectVSDevice complexity

Solution Approach 1:

The patent performs preliminary actions by systematically enumerating multiple execution plan candidates before final optimization. The system pre-generates various query placement configurations and their associated resource demands, then selects the optimal plan. This preliminary enumeration approach manages optimization complexity through structured search rather than ad-hoc decision making.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11604796B2Unified optimization of iterative analytical query processing
Publication Date: 2023.03.14 SAP SE
  • US11604796B2 patent drawing
  • US11604796B2 patent drawing
  • US11604796B2 patent drawing

AI summary

Optimization of procedures for enterprise applications can take both declarative query statements and imperative logic into account in a unified optimization technique. An input procedure can implement complex analytical queries and also include iterative control flow logic such as loops. Alternative query execution plans for the procedure can be enumerated by moving queries out of and into loop boundaries via hoist and sink operations. Program correctness can be preserved via excluding some operations via dependency graphs. Sink subgraphs can also be used. Query inlining can also be supported, resulting in synergies that produce superior execution plans. The computing execution resource demand of the respective alternatives can be considered to arrive at an optimal query execution plan that can then be used to actually implement execution of the procedure. Execution performance can thus be greatly improved by performing counterintuitive optimizations.