Compound Predicate Query Transformation via Temporary Tables

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database query statement processing techniques are inefficient, particularly for compound predicate queries, leading to significant handling time and resource consumption due to the lack of effective transformation and optimization methods.

Innovation Solution

A method is introduced that involves parsing query statements to identify compound predicates, rewriting them by generating temporary tables and specifying join functions, and evaluating candidate access paths to select the most efficient execution path, thereby reducing query handling time and resource consumption.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If compound predicate query statements are processed using existing database query processing techniques, then the query can be executed, but the handling time and resource consumption are significant and inefficient

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidquery handling time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The compound predicate query statement is segmented into multiple individual predicate queries. Each predicate is extracted and processed separately to generate candidate access paths, which are then evaluated and combined. This segmentation allows the system to handle complex queries by breaking them down into manageable components that can be optimized independently.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary parsing and analysis of the compound predicate query statement to identify individual predicates before execution. Candidate access paths are pre-evaluated for each predicate, and the optimal path is selected in advance. This preliminary action reduces the actual execution time by preparing the query structure and access strategies beforehand.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If compound predicate query statements are processed using existing database query processing techniques, then the query can be executed, but resource consumption is significant

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidresource consumption
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

By segmenting the compound predicate query into individual predicates, the system can evaluate candidate access paths for each predicate separately and combine results efficiently. This avoids the exponential resource consumption that would occur with brute-force evaluation of the entire compound query at once, reducing overall resource usage while maintaining execution correctness.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system evaluates candidate access paths partially for each predicate rather than exhaustively evaluating all possible combinations of the entire compound query. By taking partial action on each component and combining results, the system achieves sufficient optimization without the excessive resource consumption of complete enumeration.

Inventive Principle:
Principle #16Partial or excessive action

3Productivity

If compound predicate query statements are transformed by generating temporary tables and join functions, then query execution efficiency is improved, but the device complexity increases

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidquery transformation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The query transformation process is segmented into distinct phases: parsing the compound predicate query, extracting individual predicates, generating temporary tables for each predicate, creating join functions to combine results, and evaluating candidate access paths. This segmentation of the transformation process makes the complexity manageable and systematic rather than monolithic.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Temporary tables serve as intermediary structures between the original compound predicate query and the final execution plan. These temporary tables store intermediate results from individual predicate evaluations and facilitate the join operations needed to combine results. The intermediary temporary tables simplify the overall transformation complexity by providing structured intermediate storage.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11847121B2Compound predicate query statement transformation
Publication Date: 2023.12.19 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11847121B2 patent drawing
  • US11847121B2 patent drawing
  • US11847121B2 patent drawing

AI summary

Methods, computer program products, and systems are presented. The method computer program products, and systems can include, for instance: obtaining a query statement; parsing the query statement and determining from the parsing that the query statement is a compound predicate query statement that includes a first predicate and a second predicate; responsively to the parsing, rewriting the obtained query statement to provide a transformed query statement, wherein the rewriting includes (a) specifying generating of a temporary table, wherein the specified generating uses data values of the first predicate and (b) specifying a join function that uses the temporary table and a table referenced in the query statement; evaluating a candidate access path associated to the transformed query statement; selecting the candidate access path as an access path for execution; and executing the transformed query statement according to the selected candidate access path for execution.