Early Out Join for Aggregate Query Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing aggregate query optimization techniques require retrieving all qualifying rows, leading to unacceptable delays in applications like time series, where the number of input/output operations is excessive.

Innovation Solution

Implementing an early out join in the access plan for aggregate queries with a GROUP BY operation and MAX or MIN functions, where only the first qualifying row from the inner relation is retrieved for each row in the outer relation, reducing the need for unnecessary I/O operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If all qualifying rows are retrieved to compute aggregate query results, then result accuracy is ensured, but I/O operations increase significantly causing unacceptable delays

Engineering Contradiction:
Improveresult accuracyVSAvoidquery processing delay
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent extracts only the necessary portion of data (first qualifying row) from the inner relation for each outer relation row, rather than retrieving all qualifying rows. This extraction principle reduces I/O operations while maintaining result accuracy for MIN/MAX aggregate functions, directly resolving the contradiction between result accuracy and query processing delay

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies partial action by retrieving only one qualifying row from the inner relation instead of all qualifying rows. For MIN/MAX aggregate functions, this partial retrieval is sufficient to compute correct results, thereby reducing I/O operations and query processing delay while maintaining result accuracy

Inventive Principle:
Principle #16Partial or excessive action

2Reliability

If all qualifying rows are retrieved from base relations, then complete data processing is achieved, but the number of I/O operations becomes excessive

Engineering Contradiction:
Improvedata processing completenessVSAvoidI/O operation efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent extracts only the essential data needed for MIN/MAX computation (first qualifying row) from the inner relation, eliminating the need to retrieve all qualifying rows. This extraction maintains data processing reliability for aggregate queries while dramatically improving I/O operation efficiency

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent uses partial action by performing sufficient but not excessive data retrieval - obtaining only one qualifying row from the inner relation which is adequate for MIN/MAX computation. This approach ensures data processing completeness while optimizing I/O operation efficiency

Inventive Principle:
Principle #16Partial or excessive action

3Manufacturing precision

If traditional join operations are used in aggregate queries, then all matching rows are processed, but processing load increases unnecessarily

Engineering Contradiction:
Improvequery result correctnessVSAvoidprocessing load
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The patent extracts only the first qualifying row from the inner relation for each outer relation row during join operations. This extraction reduces processing load by avoiding unnecessary row comparisons while ensuring query result correctness for MIN/MAX aggregate functions through the early out mechanism

Inventive Principle:
Principle #2Taking out (Extraction)

4Productivity

If multiple I/O operations are performed to retrieve all qualifying rows, then complete result set is computed, but query execution time increases

Engineering Contradiction:
Improveresult set computationVSAvoidquery execution time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent extracts only the necessary data (first qualifying row) from the inner relation, reducing the number of I/O operations from potentially thousands to just one per outer relation row. This extraction maintains result set computation productivity while dramatically reducing query execution time

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies partial action by performing only the necessary I/O operations to retrieve one qualifying row per outer relation row, which is sufficient for MIN/MAX computation. This approach maintains result set computation productivity while minimizing query execution time

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS9524317B2Optimization of aggregate queries in database management systems using an early out join when processing min and max functions
Publication Date: 2016.12.20 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US9524317B2 patent drawing
  • US9524317B2 patent drawing
  • US9524317B2 patent drawing

AI summary

A method, computer program product, and system for optimizing aggregate queries are provided. The method, computer program product, and system provide for receiving an aggregate query comprising a GROUP BY operation and an aggregate function, creating an access plan for executing the aggregate query, the access plan including a join between an outer relation and an inner relation, and designating the join included in the access plan as an early out join.