Graph Kernel Join Cardinality Estimation

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvecardinality estimation speedVSAvoidjoin cardinality estimation accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Measurement precision

If machine learning with graph kernels is used for join cardinality estimation, then accuracy is improved, but computational complexity increases

Engineering Contradiction:
Improvejoin cardinality estimation accuracyVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #26Copying

3Ease of operation

If traditional statistical assumptions are made (column independence, join uniformity), then estimation is straightforward, but accuracy deteriorates when assumptions are violated

Engineering Contradiction:
Improveestimation simplicityVSAvoidcardinality estimation accuracy
Core Design Contradiction:
Ease of operationVSMeasurement precision

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.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11625398B1Join cardinality estimation using machine learning and graph kernels
Publication Date: 2023.04.11 TERADATA US INC
  • US11625398B1 patent drawing
  • US11625398B1 patent drawing
  • US11625398B1 patent drawing

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.