Multi-View Query Parse Tree Optimization for Redundant Depth Checks

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database query execution with multiple SQL views is inefficient due to redundant maximum depth checks, leading to time-consuming processes that reduce performance.

Innovation Solution

A method to optimize database queries with multiple views by generating a parse tree, traversing it to identify views, and performing view unfolding, attaching subtrees, and skipping redundant depth checks until the last view is reached, followed by a single maximum tree depth check.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If maximum depth check is performed multiple times for each view in a query with multiple views, then query correctness is ensured, but query execution performance deteriorates

Engineering Contradiction:
Improvequery correctnessVSAvoidquery execution performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent performs the maximum depth check only once at the beginning of query execution, before processing multiple views. This preliminary check establishes the depth limit threshold that will be applied throughout subsequent view processing, eliminating the need for repeated checks while maintaining query correctness

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates a global parse tree that serves multiple purposes: it represents the entire query structure containing multiple views, and simultaneously provides a single point for depth validation. This universal structure allows one depth check to validate the entire query rather than requiring separate checks for each view

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Reliability

If maximum depth check is performed multiple times for each view in a query with multiple views, then query validation is thorough, but execution time increases

Engineering Contradiction:
Improvequery validationVSAvoidexecution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The maximum depth check is performed once at the beginning of query execution, establishing the depth limit threshold before processing multiple views. This preliminary validation ensures query correctness while minimizing execution time by avoiding redundant checks

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent merges multiple view processing into a single global parse tree structure, allowing one depth check to validate the entire query. By combining validation into a single operation rather than separate checks for each view, execution time is reduced while maintaining thorough validation

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS20250355869A1Optimization of database queries having multiple views
Publication Date: 2025.11.20 SAP SE
  • US20250355869A1 patent drawing
  • US20250355869A1 patent drawing
  • US20250355869A1 patent drawing

AI summary

Arrangements for optimization of database queries having multiple views are provided. A query defining multiple views may be received. A parse tree may be generated based on the query. The query may be preprocessed using the parse tree. The parse tree may be traversed to identify the multiple views. View unfolding may be executed to generate a view subtree. The view subtree may be attached to the parse tree and a view query compile tree may be generated. It may be determined whether there is another view defined by the query. In response to determining that there is not another view, the parse tree may be traversed to calculate tree depth. In response to determining that there is another view defined by the query, calculation of the tree depth may be skipped.