Query Plan Cache Resizing Using Compilation Time Feedback

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The management of query plan cache size in database management systems (DBMS) is inefficient, leading to either waste of valuable cache memory when the size is too large or performance degradation due to frequent evictions and recompilations when the size is too small.

Innovation Solution

An intelligent cache manager dynamically adjusts the query plan cache size based on the differences between actual and ideal compilation times, using a timer to measure compilation times and a trend analyzer to determine adjustments, thereby optimizing cache size to balance memory usage and performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the size of query plan cache is increased, then query execution efficiency is improved by reducing evictions and recompilations, but valuable cache memory is wasted that could be used for other purposes

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidcache memory waste
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The patent implements dynamic cache size adjustment by continuously monitoring compilation time differences and automatically resizing the query plan cache accordingly. The cache manager adjusts the cache size parameter in real-time based on observed performance metrics, transforming the static cache allocation into a dynamic adaptive system that optimizes both memory utilization and query execution efficiency.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system establishes a feedback loop by measuring the difference between actual compilation time and ideal compilation time, then using this feedback to adjust cache size. When compilation time difference exceeds a threshold indicating excessive evictions, the cache size is increased. When it falls below a threshold indicating sufficient cache capacity, the size is decreased, creating a self-regulating system that balances performance and resource utilization.

Inventive Principle:
Principle #23Feedback

2Loss of energy

If the size of query plan cache is decreased, then cache memory is preserved for other uses, but query execution performance degrades due to frequent evictions and recompilations

Engineering Contradiction:
Improvecache memory availabilityVSAvoidquery execution efficiency
Core Design Contradiction:
Loss of energyVSProductivity

Solution Approach 1:

The cache size is transformed from a fixed parameter to a dynamic one that automatically adapts to workload characteristics. The system continuously monitors performance metrics and adjusts cache size in real-time, enabling the database to maintain optimal performance during high-query periods while freeing memory during low-utilization periods.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the cache size parameter based on observed compilation time differences. By monitoring whether actual compilation time significantly exceeds ideal compilation time, the system dynamically modifies the cache size parameter to prevent both memory waste and performance degradation, adapting to changing workload conditions.

Inventive Principle:
Principle #35Parameter changes

3Device complexity

If a fixed cache size is used, then system simplicity is maintained, but the system cannot adapt to varying workload conditions leading to either memory waste or performance degradation

Engineering Contradiction:
Improvecache management simplicityVSAvoidworkload adaptation capability
Core Design Contradiction:
Device complexityVSAdaptability or versatility

Solution Approach 1:

The cache management system performs self-adjustment by automatically monitoring its own performance metrics and modifying its configuration without external intervention. The cache manager independently measures compilation time differences, determines whether adjustment thresholds are exceeded, and autonomously resizing the cache, enabling the system to adapt to varying workloads while maintaining operational simplicity for users.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

A feedback mechanism is implemented where the system monitors actual versus ideal compilation times and uses this information to automatically adjust cache size. This closed-loop control enables the system to adapt to varying workload conditions while presenting a simple fixed-cache interface to users, as the adjustment happens transparently in the background.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20260105051A1Intelligent query plan cache size management
Publication Date: 2026.04.16 SAP SE
  • US20260105051A1 patent drawing
  • US20260105051A1 patent drawing
  • US20260105051A1 patent drawing

AI summary

A method for intelligent query plan cache size management can be implemented. The method measures actual compilation times of generating query execution plans for a plurality of incoming queries. At least some of the query execution plans are stored in a query execution plan cache. The method can estimate ideal compilation times of generating the query execution plans for the plurality of incoming queries under an assumption that no query execution plan is evicted from the query execution plan cache, monitor differences between the actual compilation times and the ideal compilation times in continuous time windows, and adjust a size of the query execution plan cache in runtime based on the monitored differences.