Query-Specific Database Statistics Collection for Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Database systems face inefficiencies due to missing or stale statistics, which lead to suboptimal query processing times, as existing solutions either benefit only future queries or require costly and inefficient multiple optimization attempts for current queries.

Innovation Solution

A method that collects query-specific statistics just in time for optimizing current queries, generates access plans based on these statistics, and stores them for future use, thereby reducing the need for repeated optimizer calls and improving query performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If multiple optimization attempts are made to benefit currently executing queries, then query optimization quality improves, but system efficiency deteriorates due to the high cost and complexity of multiple optimizer calls

Engineering Contradiction:
Improvequery optimization qualityVSAvoidsystem efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The system collects query-specific statistics before the optimization process begins, preparing the necessary data in advance. This preliminary action eliminates the need for multiple optimization attempts, as the optimizer can directly use the pre-collected statistics to generate optimal access plans efficiently.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system automatically collects and maintains query-specific statistics without requiring multiple manual optimization attempts. The statistics collection mechanism serves itself by continuously gathering relevant data, allowing the optimizer to function efficiently with accurate, up-to-date statistics already available.

Inventive Principle:
Principle #25Self-service

2Measurement precision

If statistics are collected and updated frequently to improve current query optimization, then query processing quality improves, but resource consumption increases

Engineering Contradiction:
Improvestatistics accuracyVSAvoidresource consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The system collects statistics that are specifically relevant to the current query rather than collecting all possible statistics. This localized approach ensures high statistics accuracy for the specific query context while minimizing unnecessary resource consumption associated with collecting and processing irrelevant statistical data.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system dynamically adjusts which statistics to collect based on the specific query characteristics and current data state. By changing the parameters of what statistics are gathered (selecting only those relevant to the current query), the system maintains high accuracy while controlling resource usage.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS8812481B2Management of interesting database statistics
Publication Date: 2014.08.19 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US8812481B2 patent drawing
  • US8812481B2 patent drawing
  • US8812481B2 patent drawing

AI summary

A method, system, and computer program product for managing database statistics are provided. The method, system, and computer program product provide for receiving a query for optimizing, collecting statistics specific to the query prior to generating any access plans for executing the query, and generating an access plan for executing the query based on the collected statistics.