Automated Query Hint Application in Database Caching

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Relational database management systems (RDBMS) face inefficiencies in processing repetitive queries, as existing systems lack automated mechanisms to optimize query execution plans during runtime without human intervention, leading to suboptimal performance and resource utilization.

Innovation Solution

A system that automatically applies query hints to query execution plans stored in a cache, using mappings between query statement hashes or patterns and hints, to optimize query processing and improve performance by reusing and refining existing plans.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If query execution plans are manually optimized, then query processing efficiency is improved, but system complexity and manual intervention requirements increase

Engineering Contradiction:
Improvequery processing efficiencyVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system automatically applies query hints to optimize query execution plans without requiring manual intervention. The automated query optimization system analyzes queries, selects appropriate hints from predefined mappings, and applies them to improve execution efficiency, allowing the system to self-optimize rather than relying on manual database administrator intervention

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

Query hints and their corresponding mappings are predefined and stored in advance. When a query is received, the system retrieves pre-configured hints based on query patterns or metadata, eliminating the need for real-time manual optimization decisions and reducing system complexity by using predetermined optimization strategies

Inventive Principle:
Principle #10Preliminary action

2Manufacturing precision

If query execution plans are optimized without automation, then optimization precision is improved, but processing time and resource utilization worsen

Engineering Contradiction:
Improveoptimization precisionVSAvoidprocessing time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The system uses predefined query hint templates and mappings that replicate proven optimization patterns. By copying and applying these pre-validated optimization strategies to new queries, the system achieves consistent optimization precision while reducing processing time compared to manual analysis and plan generation

Inventive Principle:
Principle #26Copying

3Ease of operation

If automated query optimization is implemented, then ease of operation is improved, but device complexity increases

Engineering Contradiction:
Improveease of operationVSAvoidsystem complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The automated query optimization system performs self-service by automatically analyzing queries, selecting appropriate hints, and applying optimizations without user intervention. This maintains ease of operation for end users while managing system complexity internally through predefined optimization frameworks and mappings

Inventive Principle:
Principle #25Self-service

4Adaptability or versatility

If query execution plans are generated without caching, then adaptability is improved, but productivity decreases

Engineering Contradiction:
ImproveadaptabilityVSAvoidproductivity
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The system performs preliminary actions by caching query execution plans and their associated query hints for repeated queries. When the same query is executed again, the system retrieves the pre-computed plan from the cache rather than generating it anew, significantly improving productivity while maintaining adaptability through selective caching based on query patterns and metadata

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10558663B2Automated application of query hints
Publication Date: 2020.02.11 SAP SE
  • US10558663B2 patent drawing
  • US10558663B2 patent drawing
  • US10558663B2 patent drawing

AI summary

Some embodiments provide a non-transitory machine-readable medium that stores a program. In response to receiving a first query for a set of data, the program generates a first query execution plan based on the first query. The program further executes the first query execution plan in order to generate a first result set comprising the set of data. The program also stores the first query execution plan in a cache. The program further replaces the first query execution plan in the cache with a second query execution plan. The second query execution plan includes a query hint applied to the first query execution plan. In response to receiving a second query for the set of data, the program also retrieves the second query execution plan from the cache. The program further executes the second query execution plan in order to generate a second result set comprising the set of data.