Declarative Rules for Optimized SQL Query Access
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
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
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.
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.
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
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.
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.
Data Source
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.


