Incremental Database Statistic Estimation for Unique Value Counts

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database management systems face inaccuracies in query planning due to poor estimation of unique value counts, leading to long query response times and low throughput, especially in large databases with changing data distributions.

Innovation Solution

The implementation of an incremental statistical estimator that updates unique value count statistics using multiple sampled datasets, allowing for a larger effective sample size by combining initial and subsequent samples, and determining the degree of change in data distribution to decide on incremental updates, thereby improving estimation accuracy.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If sampling is regularly updated to reflect changes in database content, then the estimation accuracy of database statistics is improved, but the query response time increases and throughput decreases

Engineering Contradiction:
Improveestimation accuracyVSAvoidquery throughput
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent implements dynamic sampling strategies that adapt to data distribution changes. The system monitors changes in database content and adjusts sampling frequency and intensity accordingly, performing more frequent sampling when data changes are detected and reducing sampling when data is stable, thereby balancing accuracy improvement with throughput maintenance

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system performs sampling on partial datasets rather than complete database scans. By using representative samples and incremental update approaches, the system achieves sufficient estimation accuracy without processing the entire database, thus maintaining query throughput while improving estimation precision

Inventive Principle:
Principle #16Partial or excessive action

2Productivity

If poor estimates are made of database statistics, then query execution may use suboptimal plans, but the immediate computational cost is low

Engineering Contradiction:
Improvequery throughputVSAvoidstatistics estimation accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The system performs preliminary sampling and estimation activities before query execution to establish accurate database statistics. By pre-computing statistical measures and maintaining up-to-date metadata about data distributions, the system ensures that query optimizers have accurate information available, leading to better query execution plans and improved throughput

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If larger samples are used to improve unique value count estimation, then estimation accuracy is improved, but the processing time and computational resources increase

Engineering Contradiction:
Improveunique value count estimation accuracyVSAvoidsampling processing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent divides the sampling process into multiple incremental stages rather than requiring a single large sample. The system collects samples in batches, processes them incrementally, and updates estimates progressively. This segmentation allows the system to achieve accurate unique value count estimates through multiple smaller processing operations rather than one time-consuming large-scale sampling operation

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10922314B2Incrementally updating a database statistic
Publication Date: 2021.02.16 ROCKET SOFTWARE
  • US10922314B2 patent drawing
  • US10922314B2 patent drawing
  • US10922314B2 patent drawing

AI summary

A technique includes determining a statistic for values associated with at least one column of a database based at least in part on a first sample of the values; and determining a degree of change in a second sample of the values relative to the first sample; and estimating a count of unique values for the column(s). The estimation of the count of unique values includes selectively incrementally updating the statistic using the second sample based at least in part on the determined degree of change; and basing estimation of the count at least in part on the updated statistic. The technique further includes processing a query to the database based at least in part on the count.