Database Query Null Property Detection and Skip Logic

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database query execution methods are inefficient due to the need to evaluate all child and sub-child expressions, even if one returns null, leading to unnecessary processing.

Innovation Solution

A database management system optimizes query execution by determining null properties of expressions and skipping unnecessary evaluations based on these properties, using null information to generate optimized query code that skips evaluations when a child or sub-child expression returns null.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If all child and sub-child expressions are evaluated in database queries, then complete calculation accuracy is achieved, but processing time and computational resources are wasted on unnecessary evaluations when a null value is encountered

Engineering Contradiction:
Improvecalculation accuracyVSAvoidquery execution time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary analysis of expression null properties before query execution. By determining whether expressions are null-preserving or null-removing in advance, the system prepares optimized execution paths that skip unnecessary evaluations, thus resolving the contradiction between complete calculation accuracy and query execution time

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The query execution system dynamically adapts its evaluation strategy based on the null properties of expressions. Instead of a static all-or-nothing evaluation approach, the system dynamically skips sub-child expression evaluations when parent expressions are determined to be null-preserving, optimizing execution time while maintaining calculation accuracy where needed

Inventive Principle:
Principle #15Dynamics

2Reliability

If all expressions in a database query are fully evaluated, then complete result accuracy is ensured, but computational resources are unnecessarily consumed

Engineering Contradiction:
Improveresult accuracyVSAvoidcomputational resource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The system performs preliminary classification of expressions by their null properties (null-preserving vs. null-removing) before execution. This advance preparation enables the system to reliably determine which evaluations are necessary for result accuracy and which can be safely skipped, reducing computational resource consumption while maintaining reliability

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Instead of fully evaluating all expressions in the query, the system performs partial evaluation by selectively skipping sub-child expressions when their parent expressions are null-preserving. This partial action approach maintains result accuracy for necessary calculations while avoiding excessive computational resource consumption on unnecessary evaluations

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS11475004B2Optimizing database queries
Publication Date: 2022.10.18 SAP SE
  • US11475004B2 patent drawing
  • US11475004B2 patent drawing
  • US11475004B2 patent drawing

AI summary

Various examples are directed to systems and methods optimizing database queries. A database management system may receive a first query comprising a plurality of query expressions. The database management system may determine that a first expression of the first query is nullable and that the first expression is null preserving. The database management system may generate optimized query code for the first query. The optimized query code may comprise a first code segment and a conditional jump instruction. The first code segment that, when executed by a processor, may cause the processor to perform operations comprising determining a value of the first expression. The conditional jump instruction may, when executed by the processor, cause the processor to perform operations comprising: skipping execution of at least a portion of the first code segment and returning null for the first expression.