Virtual Semantic Layer Rewriting Templated SQL Queries

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Query optimization in database management systems becomes complex with templated Structured Query Language (SQL) fragments, requiring efficient rewriting of queries to minimize resource drain and optimize performance, especially for joins and aggregations.

Innovation Solution

A novel framework that utilizes a virtual semantic layer to rewrite templated SQL queries based on measured nesting and dimensional structures, optimizing query execution by translating SQL fragments into more efficient forms.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If templated SQL fragments are used in a virtual semantic layer, then query flexibility and adaptability are improved, but query optimization complexity increases

Engineering Contradiction:
Improvequery flexibilityVSAvoidquery optimization complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The query optimization process is segmented into multiple distinct phases: parsing the templated SQL, generating candidate queries by substituting templates with concrete table/column names, analyzing execution plans for each candidate, and selecting the optimal query. This segmentation allows complex optimization to be broken down into manageable steps while maintaining query flexibility through template substitution.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary actions by pre-defining the templated SQL fragments and their corresponding physical table/column mappings in the virtual semantic layer. This preliminary setup allows the optimization process to focus only on substituting templates with concrete names and analyzing execution plans, rather than dealing with the full complexity of template generation and optimization simultaneously.

Inventive Principle:
Principle #10Preliminary action

2Loss of energy

If queries are rewritten to optimize performance, then database resource drain is reduced, but query execution time may increase due to rewriting overhead

Engineering Contradiction:
Improvedatabase resource drainVSAvoidquery execution time
Core Design Contradiction:
Loss of energyVSLoss of time

Solution Approach 1:

The system generates multiple candidate queries by substituting templates with different concrete table and column names, then analyzes only the execution plans of these candidates to select the optimal one. This partial action approach ensures that comprehensive optimization is achieved without requiring full rewrites of all possible query variations, balancing optimization thoroughness with execution time constraints.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The query rewriting process incorporates feedback mechanisms where the system analyzes execution plans of generated queries and uses this feedback to select the optimal query execution strategy. This feedback loop allows the system to learn from previous query executions and adjust future optimizations to minimize both resource drain and execution time.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11899664B2Computerized system and method for optimizing queries in a templated virtual semantic layer
Publication Date: 2024.02.13 YAHOO AD TECH LLC
  • US11899664B2 patent drawing
  • US11899664B2 patent drawing
  • US11899664B2 patent drawing

AI summary

A novel framework optimizes SQL queries that are generated from a templated virtual sematic layer. The framework introduces the use of a virtual semantic layer into database management systems' operations, whereby templated SQL queries can be rewritten according to a determined and measured nesting, dimensional structure that produces an optimized search system. This enables templated SQL fragments to be translated for query optimization, thereby reducing the drain on a database's resources and minimizing a query's impact on the database's performance.