Partition-Level Selectivity Estimation for Query Plan Accuracy

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing query optimization techniques in data systems face inefficiencies due to misleading statistics from large tables, leading to slow processing times and increased overhead, as methods like histogram building and data sampling are costly and time-consuming.

Innovation Solution

Implement partition-granular selectivity estimation for predicates, combining fine-granular statistics from table partitions to enhance query plan optimization, reducing computational cost and time.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If table-granular statistics are used for query optimization, then query compilation can proceed with available statistics, but the statistics become misleading and reduce accuracy 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 statistics at the partition level rather than table level. This segmentation allows for more accurate selectivity estimation by capturing local data characteristics in each partition, resolving the issue where table-granular statistics become misleading as table size increases.

Inventive Principle:
Principle #1Segmentation

2Measurement precision

If histograms are built to improve selectivity estimation accuracy, then measurement precision improves, but the cost to build and maintain histograms increases

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

Solution Approach 1:

The patent enables the system to automatically collect and maintain partition-granular statistics as data is loaded or modified, eliminating the need for separate histogram building and maintenance processes. This self-service approach provides accurate selectivity estimation without the manual intervention and complexity associated with traditional histogram management.

Inventive Principle:
Principle #25Self-service

3Measurement precision

If data sampling is used to obtain statistics, then selectivity estimation can be improved, but additional queries are required which increase overhead cost and time

Engineering Contradiction:
Improveselectivity estimation accuracyVSAvoidquery compilation time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent collects and stores partition-granular statistics in advance as data is loaded or modified, so that accurate selectivity estimation is immediately available when queries are compiled. This preliminary action eliminates the need to run additional sampling queries at query compilation time, reducing overhead and compilation time while maintaining high estimation accuracy.

Inventive Principle:
Principle #10Preliminary action

4Productivity

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

Engineering Contradiction:
Improvequery processing efficiencyVSAvoidstatistics management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent merges the statistics collection and maintenance process into the existing data loading and modification operations. By integrating partition-granular statistics management with routine data operations, the system achieves improved query processing efficiency without adding separate complexity layers for statistics management.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS12475125B2Partition granular selectivity estimation for predicates
Publication Date: 2025.11.18 SNOWFLAKE INC
  • US12475125B2 patent drawing
  • US12475125B2 patent drawing
  • US12475125B2 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.