Recursive Query Optimizer Iteration Estimation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Optimizing recursive database queries is challenging due to varying cardinalities across iterations, leading to suboptimal execution plans when static planning schemes are used, and providing feedback at each iteration can disrupt execution and pipelining.

Innovation Solution

Estimating the number of iterations or self-joins required for a recursive database query allows for dynamic planning of execution, using a Recursive Query Optimizer to generate optimal plans based on projected iteration counts, and adjusting plans at each iteration based on actual statistics.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If static planning schemes are used for recursive queries, then execution plans can be determined in advance, but the plans become suboptimal when cardinalities vary across iterations

Engineering Contradiction:
ImproveQuery execution timeVSAvoidAdaptability to varying cardinalities
Core Design Contradiction:
Loss of timeVSAdaptability or versatility

Solution Approach 1:

The patent implements dynamic query plan adjustment by estimating the number of iterations required for recursive queries and adapting the execution plan accordingly. The system calculates cardinality estimates for each iteration level and selects optimal execution plans dynamically based on these estimates, allowing the plan to adapt to varying cardinalities rather than using a fixed static plan.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent performs preliminary cardinality estimation by analyzing the recursive query structure and estimating the number of iterations and cardinality at each level before actual execution. This preliminary analysis allows the system to pre-determine optimal execution strategies and resource allocation, avoiding the need for trial-and-error during execution.

Inventive Principle:
Principle #10Preliminary action

2Manufacturing precision

If feedback is provided at each iteration to improve optimization, then execution plans can be adjusted to actual statistics, but this disrupts execution and pipelining

Engineering Contradiction:
ImproveExecution plan accuracyVSAvoidExecution throughput
Core Design Contradiction:
Manufacturing precisionVSProductivity

Solution Approach 1:

The patent performs all necessary optimization decisions in advance by estimating iteration counts and cardinalities before execution begins. The system determines the optimal execution plan and resource allocation preliminarily, eliminating the need for iterative feedback adjustments during execution and thus maintaining continuous pipelining and high throughput.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses feedback from cardinality estimates and iteration predictions to refine the execution plan selection process. By incorporating these feedback mechanisms during the planning phase rather than during execution, the system achieves accurate execution plans without disrupting the execution pipeline.

Inventive Principle:
Principle #23Feedback

3Productivity

If the number of iterations is estimated to enable dynamic planning, then execution efficiency improves, but the estimation process adds complexity to the query optimization system

Engineering Contradiction:
ImproveQuery execution efficiencyVSAvoidOptimizer complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the complex query optimization process into distinct manageable components: parsing the recursive query, estimating iteration counts, calculating cardinality estimates for each level, and selecting optimal execution plans. This segmentation allows each component to be optimized independently, reducing overall system complexity while maintaining high execution efficiency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes key parameters such as iteration count estimates and cardinality predictions to guide the optimization process. By using these parameter estimates, the system can efficiently select execution plans without requiring complex real-time analysis during execution, thus improving productivity while controlling complexity through parameter-based decision making.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS9152670B2Estimating number of iterations or self joins required to evaluate iterative or recursive database queries
Publication Date: 2015.10.06 TERADATA CORP
  • US9152670B2 patent drawing
  • US9152670B2 patent drawing
  • US9152670B2 patent drawing

AI summary

The number of iterations or self joins required to execute a recursive database query can be estimated. It will be appreciated that this estimation can be used to plan the execution of the recursive query and can be made in various ways and for various applications. By way of example, an estimated number of iterations or self joins required to execute a recursive database query (e.g., 12) can be used as a basis to determine or plan an optimal execution plan. For example, given an estimated twelve (12) iterations, an execution plan can be determined for executing at least the first three (3) iterations or for executing every three (3) iterations, whereas for an estimated twenty (21) iterations required to complete a recursive database query, an execution plan can be determined for the first five (5) or six (6) iterations, and so on.