Partition-Level Selectivity Estimation for Query Plan Accuracy

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing query optimization methods in large data systems face inefficiencies due to misleading table-level statistics and the overhead of histogram management or data sampling, leading to prolonged processing times and increased costs.

Innovation Solution

Implement partition-granular selectivity estimation techniques to accurately calculate and utilize fine-grained statistics from table partitions, combining them for improved query plan optimization and reduced computational costs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If table-level statistics are used for query optimization, then query compilation can proceed with available statistics, but the statistics become misleading and accuracy deteriorates as table size increases

Engineering Contradiction:
Improveselectivity estimation accuracyVSAvoidtable size
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent divides the table into multiple partitions and maintains separate statistics for each partition. This segmentation allows the system to capture data distribution characteristics at a finer granularity, preventing the loss of accuracy that occurs when aggregating all data into single table-level statistics. The query optimizer can then combine partition-level estimates to achieve accurate overall selectivity estimation even for large tables.

Inventive Principle:
Principle #1Segmentation

2Measurement precision

If histograms are built to improve selectivity estimation accuracy, then measurement precision improves, but the complexity of building and managing histograms increases

Engineering Contradiction:
Improveselectivity estimation accuracyVSAvoidhistogram management complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent extracts only the essential statistical features needed for selectivity estimation from each partition (such as min, max, null counts, and distinct value counts) rather than building complete histograms. This extraction approach captures the necessary information for accurate estimation while avoiding the complexity of full histogram construction, maintenance, and updates.

Inventive Principle:
Principle #2Taking out (Extraction)

3Measurement precision

If data sampling is used to obtain statistics, then measurement precision can improve, but additional queries are required which increases overhead cost and time

Engineering Contradiction:
Improvestatistics accuracyVSAvoidquery compilation time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent computes partition-level statistics during data loading or ETL processes, performing the statistical analysis in advance before queries are executed. This preliminary computation ensures that accurate statistics are already available when query compilation occurs, eliminating the need for additional sampling queries and reducing query compilation time.

Inventive Principle:
Principle #10Preliminary action

4Productivity

If partition-granular selectivity estimation is implemented, then query processing efficiency improves, but the complexity of calculating and combining partition statistics increases

Engineering Contradiction:
Improvequery processing efficiencyVSAvoidselectivity estimation calculation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent merges partition-level selectivity estimates by applying simple combinatorial logic based on the query predicate and partition characteristics. This combining process is designed to be computationally efficient, using straightforward mathematical operations rather than complex algorithms, thereby maintaining query processing efficiency while achieving accurate results.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS20260044507A1Partition granular selectivity estimation for predicates
Publication Date: 2026.02.12 SNOWFLAKE INC
  • US20260044507A1 patent drawing
  • US20260044507A1 patent drawing
  • US20260044507A1 patent drawing

AI summary

A query engine can use partition-granular level statistics to optimize query performance. A query can reference a table with a plurality of partitions and include a predicate. A partition-granular selectivity estimate for the predicate can be generated based on statistics stored regarding the plurality of partitions of the table. A query plan can be generated based on partition-granular selectivity estimate to optimize query processing.