Partition-Level Selectivity Estimation for Query Plan Accuracy
Find Innovative SolutionsGenerate 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
Engineering 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
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.
2Measurement precision
If histograms are built to improve selectivity estimation accuracy, then measurement precision improves, but the cost to build and maintain histograms increases
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.
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
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.
4Productivity
If partition-granular selectivity estimation is implemented, then query processing efficiency improves, but the complexity of statistics management increases
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.
Data Source
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.


