Query Optimizer Alternate Plan Analysis for Execution Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing query optimization techniques in database systems often generate execution plans that are either incorrect or inefficient, making it difficult to detect and resolve issues with these plans.

Innovation Solution

The implementation of alternate plan analysis, which selects a subset of candidate execution plans, executes them, and generates output for comparison to determine if the least cost plan is the most efficient, and whether results are correct, using analysis parameters to control the process and provide detailed performance metrics.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If a query optimizer generates an execution plan optimized for efficient execution, then execution speed is improved, but the plan may be incorrect or perform poorly in practice

Engineering Contradiction:
Improvequery execution speedVSAvoidexecution plan correctness
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The system performs preliminary actions by generating multiple alternative execution plans before actual query execution. The query optimizer creates several candidate plans with different execution strategies, and the system prepares to evaluate these plans by comparing their actual execution performance against estimated costs, allowing selection of the most reliable plan before full execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system implements feedback mechanisms by comparing actual execution performance of alternative plans against the query optimizer's cost estimates. By monitoring actual execution time and resource consumption, the system provides feedback to identify which alternative plans perform better than expected, allowing continuous improvement of plan selection accuracy and reliability.

Inventive Principle:
Principle #23Feedback

2Use of energy by moving object

If the query optimizer selects the least cost execution plan, then resource efficiency is improved, but the plan may not be the most efficient in actual execution

Engineering Contradiction:
Improveresource efficiencyVSAvoidactual execution efficiency
Core Design Contradiction:
Use of energy by moving objectVSProductivity

Solution Approach 1:

The system applies dynamics by making the execution plan selection adaptive rather than static. Instead of always selecting the single least cost plan, the system dynamically evaluates multiple alternative plans and selects the one that actually performs best in practice. This dynamic approach allows the system to adapt to real execution conditions that may differ from optimizer estimates.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes parameters by considering multiple execution plans with different cost parameters and execution characteristics. By varying the selection criteria among alternative plans based on actual performance feedback, the system adjusts which plan parameters (execution time, resource consumption, I/O operations) are optimized, rather than relying on a single fixed optimization criterion.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If alternative plan analysis is performed to detect correctness issues, then execution plan reliability is improved, but the complexity of the system increases

Engineering Contradiction:
Improveexecution plan correctnessVSAvoidsystem complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system segments the execution plan evaluation process by dividing it into distinct components: generation of alternative plans, execution of each alternative plan, comparison of actual performance against estimates, and selection of the best plan. This segmentation allows each component to be handled independently, managing complexity through modular organization of the analysis process.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system extracts the complexity of alternative plan analysis as a separate, dedicated function rather than embedding it throughout the entire query processing system. By isolating the alternative plan generation, execution, and comparison operations into a distinct analysis module, the system manages complexity by separating concerns and allowing the core query optimizer to remain relatively simple while adding reliability through the extracted analysis functionality.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS7877373B2Executing alternative plans for a SQL statement
Publication Date: 2011.01.25 ORACLE INT CORP
  • US7877373B2 patent drawing
  • US7877373B2 patent drawing
  • US7877373B2 patent drawing

AI summary

Under automated alternate plan analysis, a query optimizer generates candidate execution plans. The candidate execution plans are selected as alternate execution plans for the query and execution. Output describing characteristics of each alternate execution plan and/or its execution is generated and/or compared. From this information, it may be determined, for example, whether results returned by any of the alternate execution plans are the same and whether the least cost execution plan is actually the most efficiently executed.