Graph Kernel Join Cardinality Estimation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current database query optimizers face inaccuracies in join cardinality estimation due to assumptions about column independence and data distribution, leading to suboptimal query plans and poor performance, especially when data distribution is skewed, and maintaining accurate statistics is complex and computationally intensive.
Innovation Solution
A graph-based representation of join plans is used instead of feature vectors, employing machine learning techniques like Support Vector Regression with subtree kernels to predict cardinality, leveraging structural similarities in join plans to improve estimation accuracy.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If statistical methods are used for join cardinality estimation, then the process is simple and fast, but accuracy deteriorates when data distribution is skewed or assumptions are violated
Solution Approach 1:
The patent introduces graph kernels as an intermediary between query plans and cardinality estimation. Instead of directly applying statistical formulas, the system converts query plans into graph representations and uses kernel methods to compute similarity-based estimates, thereby avoiding the assumptions and inaccuracies of traditional statistical methods while maintaining computational efficiency.
Solution Approach 2:
The patent replaces the mechanical statistical estimation system with a machine learning-based graph kernel system. This substitution eliminates the need for assumptions about column independence and uniform join distribution, using instead a similarity-based approach that adapts to actual data patterns without requiring explicit statistical models.
2Measurement precision
If machine learning with graph kernels is used for join cardinality estimation, then accuracy is improved, but computational complexity increases
Solution Approach 1:
The patent performs preliminary conversion of query plans into graph representations that can be reused for similarity comparisons. By pre-processing query plans into a standardized graph format, the system enables efficient kernel computations without repeatedly parsing and analyzing query structures, thereby reducing the computational overhead of the machine learning approach.
Solution Approach 2:
The patent uses graph kernel methods that compute similarity between query plans by comparing their graph representations. This copying-based approach allows the system to leverage patterns from previously executed queries without re-analyzing their full execution contexts, significantly reducing computational complexity while maintaining high estimation accuracy.
3Ease of operation
If traditional statistical assumptions are made (column independence, join uniformity), then estimation is straightforward, but accuracy deteriorates when assumptions are violated
Solution Approach 1:
The patent fundamentally changes the parameters used for cardinality estimation from statistical aggregates (counts, distinct values) to graph-based structural representations. This parameter transformation allows the system to capture complex relationships and data distribution patterns that violate traditional assumptions, while the graph kernel computation remains mathematically tractable and conceptually simple.
Data Source
AI summary
A cardinality of a query is estimated by creating a join plan for the query. The join plan is converted to a graph representation. A subtree graph kernel matrix is generated for the graph representation of the join plan. The subtree graph kernel matrix is submitted to a trained model for cardinality prediction which produces a predicted cardinality of the query.


