Database Query Optimization with Tempdb Resource Awareness

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database management systems fail to effectively account for limited resource usage, such as temporary database storage, during query optimization, leading to potential plan execution failures due to resource starvation.

Innovation Solution

Implement a system that identifies and considers limited resource usage, specifically temporary database usage, during query optimization by determining if any possible plan exceeds a threshold level, and if so, flags it as an overflow plan, prioritizing non-overflowing plans in the optimization process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the optimizer selects the cheapest query execution plan without considering tempdb usage, then query execution cost is minimized, but resource starvation may occur when tempdb resources are insufficient

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidplan execution success rate
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent changes the optimization parameter from purely cost-based to a composite parameter that includes both cost and tempdb usage. The query optimizer now evaluates plans based on multiple parameters: traditional cost metrics and temporary database consumption, allowing it to select plans that balance both efficiency and resource constraints

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The system dynamically adjusts plan selection based on available tempdb resources. When tempdb resources are sufficient, the optimizer may choose cost-optimized plans; when resources are constrained, it dynamically shifts to selecting plans with lower tempdb requirements, making the optimization behavior adaptive to current system state

Inventive Principle:
Principle #15Dynamics

2Device complexity

If the optimizer assumes unlimited tempdb availability, then plan selection is simplified, but the selected plan may fail when tempdb resources are exhausted

Engineering Contradiction:
Improveoptimization process complexityVSAvoidresource availability
Core Design Contradiction:
Device complexityVSReliability

Solution Approach 1:

The system performs preliminary evaluation of tempdb requirements for each candidate plan before final selection. The query optimizer estimates the temporary database usage for each possible execution plan in advance, allowing it to filter or reweight plans based on their resource requirements before committing to a selection

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system incorporates feedback mechanisms where actual tempdb usage from historical query executions is fed back to the optimizer. This feedback loop allows the optimizer to learn from past resource consumption patterns and improve its predictions of tempdb requirements for different query plans

Inventive Principle:
Principle #23Feedback

3Adaptability or versatility

If multiple query plans compete for limited tempdb resources, then resource contention increases, but starvation of other query plans occurs

Engineering Contradiction:
Improveresource allocation flexibilityVSAvoidoverall system throughput
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent creates a universal resource awareness mechanism that applies to all query plans regardless of their specific operations. The tempdb usage estimation and consideration framework is universally applied across different query types, optimization strategies, and execution plans, providing consistent resource-aware optimization throughout the system

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS8712972B2Query optimization with awareness of limited resource usage
Publication Date: 2014.04.29 SYBASE INC
  • US8712972B2 patent drawing
  • US8712972B2 patent drawing
  • US8712972B2 patent drawing

AI summary

System, method, computer program product embodiments and combinations and sub-combinations thereof for tuning query execution performance in a database management system are described. In an aspect, query optimization in a database management system (DBMS) with awareness of limited resource usage includes identifying limited resource usage for each possible plan being considered for query execution by a query engine. A determination of whether any possible plan has limited resource usage that does not exceed a threshold level is made, and when at least one possible plan does not exceed the threshold level, the identified limited resource usage is included as a consideration during plan selection by the query engine. In an embodiment, temporary database usage is identified for each possible plan.