Query Optimization Using Propagated Distinct Value Estimation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current query optimization techniques in distributed computing environments are inefficient as they do not accurately estimate the number of distinct values and data volume post-operation, leading to suboptimal execution plans and resource utilization.
Innovation Solution
The use of a combinable distinct value estimation data structure, such as the k minimum value (KMV) synopsis, to propagate distinct value estimation from leaf nodes up the query tree, allowing the query optimizer to evaluate candidate query trees based on actual data operations and select the most efficient optimization by considering the execution burden factor.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If traditional query optimization techniques are used in distributed computing environments, then the query execution can be performed, but the estimation of distinct values and data volume is inaccurate leading to suboptimal execution plans
Solution Approach 1:
The patent uses KMV synopses which are compact data structures that copy and summarize the distribution of distinct values in large datasets. Instead of analyzing the entire distributed dataset, the system maintains compressed representations (copies) of the data characteristics that enable accurate distinct value estimation without processing the full data volume.
Solution Approach 2:
The patent transforms the query optimization problem by changing the parameter representation from exact distinct value counts to probabilistic estimates using KMV synopses. This parameter transformation allows the optimizer to work with approximate values that are computationally efficient to calculate and combine, while still providing sufficient accuracy for optimization decisions.
2Measurement precision
If accurate distinct value estimation is performed using traditional methods, then measurement precision improves, but the computational complexity and time required for query optimization increases significantly
Solution Approach 1:
The KMV synopsis creates a compact copy of the data's distinct value distribution, allowing the system to estimate data volume and distinct values without examining the actual distributed data. This copied representation dramatically reduces the computational complexity while maintaining estimation accuracy.
Solution Approach 2:
The patent segments the distributed dataset into multiple partitions, each with its own KMV synopsis. The overall distinct value estimation is then derived by combining these segmented estimates using set theory operations on the KMV structures, reducing the complexity of analyzing the entire distributed system at once.
3Productivity
If candidate query trees are evaluated without accurate distinct value estimation, then the optimization process is faster, but the selected execution plan is suboptimal leading to worse resource utilization
Solution Approach 1:
The patent performs preliminary computation of KMV synopses for all base tables and intermediate results before query optimization. This preliminary action prepares the distinct value estimation data in advance, allowing the query optimizer to quickly evaluate multiple candidate query trees using pre-computed estimates rather than calculating them during the optimization process.
Solution Approach 2:
By maintaining KMV synopsis copies of intermediate query results and using set operations to estimate distinct values for candidate query trees, the system can evaluate multiple execution plans quickly. The copying mechanism allows rapid estimation without re-analyzing the actual data for each candidate plan.
Data Source
AI summary
Query optimization using of a query that is compiled into a query tree. The optimization is efficiently performed by using a distinct value estimation data structure (e.g., a KMV synopsis) that represents within an interval distinctness of values that are generated based on data within an interval, even if the resultant data from a subinterval is considered. Various candidate query trees are evaluated, with distinct value generation data structures being propagated for parent nodes based on the distinct value generation data structures of its child node(s). Propagation operations correlate to the operation represented by the parent node in the query tree. The optimizer uses the propagated distinct value estimation structure in order to evaluate the number of distinct values of data that would result from execution of the candidate query tree at least at the corresponding operations (and not just based on the distinct values of the input data).


