Query Plan Fragment Caching for Faster Plan Adaptation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Determining query plans in database systems is resource-intensive and inefficient when modifications are needed, as caching only the selected plan leads to repeated calculations and wasted work on unselected plans.

Innovation Solution

Cache query plan fragments of unselected plans to facilitate rapid modification and reuse, allowing the database system to automatically diagnose and remediate problematic plans by replacing fragments with cached alternatives based on performance metrics.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If only the selected query plan is cached, then memory usage is reduced, but significant work is repeated when modifying the plan

Engineering Contradiction:
Improvetime to determine query planVSAvoidwork on unselected plans
Core Design Contradiction:
Loss of timeVSQuantity of substance

Solution Approach 1:

The patent divides the query plan into fragments that can be independently cached and reused. Instead of caching the entire selected plan or discarding unselected plans, the system segments the evaluation work into reusable fragments, allowing selective reuse of useful portions while avoiding redundant calculations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary evaluation of multiple query plans and caches their fragments before the final plan is selected. This preliminary action allows the system to reuse evaluation results when modifying plans, avoiding the need to re-evaluate unselected plans from scratch.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If multiple query plans are evaluated thoroughly, then plan quality is improved, but processor and memory resources are consumed excessively

Engineering Contradiction:
Improvequality of query planVSAvoidprocessor and memory resources
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent applies local quality by evaluating and caching only the necessary fragments of query plans rather than completely evaluating all possible plans. This allows the system to maintain high plan quality for critical portions while reducing resource consumption for less important evaluation work.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent creates copies of query plan fragments from unselected plans and stores them in a cache. These copies can be reused when modifying the selected plan, eliminating the need to re-evaluate and resource-intensive complete plan determinations.

Inventive Principle:
Principle #26Copying

3Adaptability or versatility

If query plan modifications are made frequently, then adaptability is improved, but repeated determination process increases overhead

Engineering Contradiction:
Improveability to modify query plansVSAvoidoverhead of determination process
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent implements a dynamic caching mechanism that adapts to plan modifications. When a plan is modified, the system dynamically determines which fragments to reuse from the cache and which need to be re-evaluated, optimizing the balance between adaptability and overhead.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent recovers useful work by caching query plan fragments from unselected plans and reusing them when modifications are needed. Instead of discarding the evaluation work on unselected plans, the system recovers and reuses the useful fragments, reducing the overhead of repeated determinations.

Inventive Principle:
Principle #34Discarding and recovering

Data Source

PatentUS20250245224A1Query Plan Adaptation Using Query Plan Fragments
Publication Date: 2025.07.31 SALESFORCE INC
  • US20250245224A1 patent drawing
  • US20250245224A1 patent drawing
  • US20250245224A1 patent drawing

AI summary

Techniques are disclosed relating to determining query plans for execution by database systems. In various embodiments, a query optimizer determines a first query plan to implement a query requesting data from a database system. The determining includes selecting one of a plurality of query plans evaluated based on a cost analysis and caching plan fragments of the unselected query plans. The database system can then determine a second query plan for the query by replacing a plan fragment in the first query plan with one of the cached plan fragments of the unselected query plans.