Declarative Rules for Optimized SQL Query Access

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database systems face inefficiencies in query optimization due to the need to search wider pools of data, which can include expensive or slow storage media, and lack of domain-specific knowledge application during query execution.

Innovation Solution

The implementation of declarative rules that match domain knowledge to optimize queries by adding additional predicates, focusing the search area and excluding unnecessary data sets, thereby enhancing query efficiency and resource utilization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the query optimizer searches wider pools of data to ensure comprehensive results, then the completeness and accuracy of query results is improved, but the query execution time and resource consumption increases

Engineering Contradiction:
Improvecompleteness of query resultsVSAvoidquery execution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-computing and storing domain knowledge rules (such as filter criteria, data relationships, and optimization patterns) in a ruleset. During query optimization, these pre-prepared rules are applied to the query plan, allowing the optimizer to make informed decisions without exhaustively searching all possible query plans. This preliminary preparation of optimization rules resolves the contradiction by providing guidance that ensures comprehensive results while reducing execution time.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary component - the ruleset containing domain-specific optimization rules - that mediates between the query optimizer and the data pool. This ruleset acts as a knowledge intermediary that translates domain expertise into actionable optimization directives, enabling the optimizer to navigate the search space more efficiently while maintaining result completeness. The ruleset intermediary resolves the contradiction by bridging the gap between comprehensive search requirements and time constraints.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If the query optimizer accesses expensive or slow storage media to retrieve comprehensive data sets, then the accuracy of query results is improved, but the resource consumption and cost increases

Engineering Contradiction:
Improveaccuracy of query resultsVSAvoidresource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The system pre-computes and stores domain knowledge rules that identify which data subsets are relevant for different query types. During query execution, these pre-prepared rules guide the optimizer to access only the necessary data from storage media, avoiding unnecessary reads from expensive or slow storage. This preliminary preparation of access patterns resolves the contradiction by ensuring accurate results are obtained while minimizing resource consumption.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent applies local quality by making the query optimization process adaptive to specific query characteristics and data distribution patterns. The ruleset contains localized knowledge about data relationships and access patterns that enable the optimizer to tailor its data access strategy to each query's specific needs. This localized optimization resolves the contradiction by accessing only the necessary portions of storage media with appropriate access methods, maintaining accuracy while reducing overall resource consumption.

Inventive Principle:
Principle #3Local quality

3Productivity

If the query optimizer performs exhaustive search of all possible query plans to find the best performing plan, then the query execution efficiency is improved, but the optimization time and computational complexity increases

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidoptimization complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent introduces a ruleset intermediary that contains pre-computed domain knowledge about query optimization patterns, data relationships, and performance heuristics. This ruleset mediates between the exhaustive search approach and the need for reduced complexity by providing guidance that prunes the search space. The optimizer uses these intermediary rules to evaluate and rank query plans more efficiently, resolving the contradiction by maintaining thorough evaluation while reducing computational complexity through knowledge-guided search.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system changes the parameters of the optimization process by incorporating domain knowledge rules that transform the optimization problem from a brute-force search to a guided search. The ruleset provides additional parameters such as data selectivity estimates, join order preferences, and access path recommendations that change the optimization landscape. This parameter enrichment resolves the contradiction by enabling more efficient exploration of the query plan space while maintaining the goal of finding high-performance execution plans.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS10592509B2Declarative rules for optimized access to data
Publication Date: 2020.03.17 SAP SE
  • US10592509B2 patent drawing
  • US10592509B2 patent drawing
  • US10592509B2 patent drawing

AI summary

The present disclosure involves systems, software, and computer implemented methods for using declarative rules for optimized access to data. One example method includes receiving a structured query language (SQL) query, the SQL query associated with at least one database table and at least one predicate. A determination is made as to whether the SQL query is associated with at least one declarative rule based on the at least one database table and the at least one predicate. In response to determining that the SQL query is associated with at least one declarative rule, the at least one associated declarative rule is applied, during optimization of the SQL query. The at least one declarative rule defines a transformation to the SQL query to be performed during query optimization. An updated SQL query is generated based on the applied at least one associated declarative rule and the updated SQL query is provided.