Dynamic Join Index Caching for Query Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current query optimization techniques in relational database management systems do not fully address the issue of redundant computations in shared query expressions, leading to suboptimal performance when similar queries are executed multiple times.

Innovation Solution

Implementing a Dynamic Join Index (DJI) caching mechanism within the Query Expression Repository (QER) to cache results of frequently used query expressions, which are then reused to reduce redundant computations and improve query performance by rewriting subsequent queries to utilize cached results.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If query expression results are cached in a standard QER, then query performance improves through reuse, but storage space is wasted on caching results of infrequently used queries

Engineering Contradiction:
Improvequery performanceVSAvoidstorage space
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent implements a dynamic join index that automatically adapts its caching behavior based on query frequency and resource availability. The system monitors query execution patterns and dynamically adjusts which query expressions are cached and for how long, transitioning from static caching to adaptive caching that responds to changing workload characteristics.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes the state of cached query results from permanent to temporary, introducing time-to-live parameters and frequency-based expiration. Query results are cached with dynamic validity periods that adjust based on usage patterns, allowing the system to optimize between storage utilization and query performance by expiring old or rarely accessed results.

Inventive Principle:
Principle #35Parameter changes

2Loss of time

If all query expression results are cached, then redundant computations are eliminated, but memory overhead increases significantly

Engineering Contradiction:
Improveredundant computation timeVSAvoidmemory overhead
Core Design Contradiction:
Loss of timeVSQuantity of substance

Solution Approach 1:

Instead of caching all query expression results, the system selectively caches only those results that meet specific criteria such as high frequency of reuse, large computational cost, and small result size. This partial caching approach focuses resources on the most beneficial cases rather than attempting to cache everything.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent applies different caching strategies to different query expressions based on their individual characteristics. High-frequency, expensive-to-compute queries receive aggressive caching, while low-frequency or simple queries use minimal or no caching, creating a differentiated caching policy that optimizes overall system performance.

Inventive Principle:
Principle #3Local quality

3Productivity

If query results are cached indefinitely, then query performance improves through maximum reuse, but the system cannot adapt to data changes

Engineering Contradiction:
Improvequery performanceVSAvoidadaptability to data changes
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system implements periodic validation and expiration of cached query results based on underlying data change detection. Query results are cached for fixed periods and automatically refreshed or invalidated when the underlying data changes, creating a rhythmic pattern of caching and validation that balances performance and freshness.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The patent incorporates feedback mechanisms that monitor data changes and automatically adjust caching behavior. When data modification patterns are detected, the system receives feedback to invalidate or refresh relevant cached results, ensuring that cached data remains consistent with the current state of the database.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12141146B2Query expression result caching using dynamic join index
Publication Date: 2024.11.12 TERADATA US INC
  • US12141146B2 patent drawing
  • US12141146B2 patent drawing
  • US12141146B2 patent drawing

AI summary

An apparatus, method and computer program product for query optimization in a Relational Database Management System (RDBMS), wherein an optimizer accesses a query expression repository (QER) storing planning and execution information for QEs from previous queries, wherein the QEs comprise table relations, intermediate results and/or final results of operations in the previous queries. Additionally, dynamic join indexes representing QE results are created for high-value QEs selected from the QER and maintained within a DJI repository. During query plan creation for a current or subsequent query, the optimizer searches the QER and DJI repository for DJIs created for high-value QEs corresponding to QEs contained in the current or subsequent query. DJIs corresponding to the matching QEs are used in the query planning phase to rewrite the current or subsequent user query so that stored QE results are used to answer QEs contained in the current or subsequent query.