Left-Deep Tree Join Enumeration for Subquery Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Database systems face challenges in optimizing queries on small computing devices due to memory constraints and the need to integrate subquery optimization without increasing memory requirements or search space, particularly in cost-based subquery optimization.

Innovation Solution

A methodology using a left-deep tree join enumeration algorithm that treats subqueries similarly to base or derived tables, defining access and join methods, and employing hash filters to reduce memory usage and search space, allowing for efficient query optimization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional subquery optimization methods are used, then query optimization capability is improved, but memory requirements and search space increase

Engineering Contradiction:
Improvequery optimization capabilityVSAvoidmemory requirements
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent segments the query optimization process into distinct phases: building a query optimization graph for each query block, generating access and join methods separately, and determining optimal plans through systematic evaluation. This segmentation allows memory-efficient processing by handling subqueries as discrete units rather than transforming entire query structures, thus improving query optimization capability without proportionally increasing memory requirements.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial action by focusing optimization efforts on specific query blocks and subqueries individually through the query optimization graph, rather than attempting to optimize the entire query simultaneously. This approach enables effective query optimization for each subquery while avoiding the exponential memory growth that would result from comprehensive query transformation, thus resolving the contradiction between optimization capability and memory usage.

Inventive Principle:
Principle #16Partial or excessive action

2Productivity

If comprehensive query optimization is performed, then query execution efficiency is improved, but search space complexity increases

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidsearch space complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent divides the search space into manageable segments by creating separate query optimization graphs for each query block and subquery. Each graph represents a discrete optimization problem with its own set of plan nodes, access methods, and join methods. This segmentation reduces search space complexity by preventing the combinatorial explosion that would occur if all possible query transformations were considered simultaneously, while still achieving comprehensive optimization through systematic evaluation of each segment.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary action by pre-generating sets of access methods and join methods for each plan node before determining the optimal access plan. This preliminary enumeration of possibilities allows the optimizer to evaluate and compare methods systematically without exploring the entire search space exhaustively during query execution, thus improving query execution efficiency while keeping search space complexity manageable through advance preparation.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS7617179B2System and methodology for cost-based subquery optimization using a left-deep tree join enumeration algorithm
Publication Date: 2009.11.10 SAP SE
  • US7617179B2 patent drawing
  • US7617179B2 patent drawing
  • US7617179B2 patent drawing

AI summary

A system providing methodology for cost-based enumeration of subqueries using a left-deep tree join enumeration algorithm is described. In one embodiment, for example, in a database system, a method of the present invention is described for optimizing a database query, the method comprises steps of: receiving a database query including at least one subquery; building a query optimization graph for each query block of the database query, the query optimization graph including plan nodes representing subqueries of each query block; generating a set of access methods and join methods for each plan node, including generating at least one access method for a subquery quantifier based on subquery type and semantic properties of the database query; determining an optimal access plan for each query block based upon selecting access methods, join methods, and join order for plan nodes of the query optimization graph having favorable execution costs; and constructing a detailed access plan for execution of the database query based upon the optimal access plan determined for each query block.