Neural Network Join Order Cost Prediction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional database management systems face challenges in accurately predicting the costs of query execution due to similar representation information generated for different join orders, leading to ineffective selection of target join orders by the optimizer.

Innovation Solution

A database processing method that utilizes a tree structure to represent join orders, inputted into a neural network with a feature extraction layer and a cost prediction layer, to allocate attribute matrices to child nodes and perform feature extraction, enabling the differentiation of join orders and accurate cost prediction.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional feature extraction methods are used on join orders, then the process is simple, but different join orders generate the same representation information, causing inaccurate cost prediction

Engineering Contradiction:
Improvecost prediction accuracyVSAvoidfeature extraction complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the join order representation into multiple dimensions: table identifiers, join types, join conditions, and tree structure relationships. Each dimension is processed separately through dedicated neural network layers, allowing the system to capture nuanced differences between join orders that conventional methods miss, thereby improving cost prediction accuracy without overwhelming complexity

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transforms the conventional flat feature extraction into a multi-dimensional representation by introducing tree structure awareness, positional information, and relationship features. This dimensional expansion allows the system to distinguish between different join orders that would otherwise have identical representations, resolving the accuracy-complexity contradiction

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Productivity

If the optimizer uses inaccurate cost predictions, then the selection process is fast, but the selected join order is not optimal, increasing query execution time

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidquery execution time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent implements a feedback mechanism where the cost prediction model uses accurate multi-dimensional features to predict execution costs, and this accurate prediction feeds back to the optimizer's decision-making process. The system continuously learns from execution outcomes, refining its cost predictions to better identify optimal join orders, thereby reducing actual query execution time while maintaining efficient optimization

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent performs preliminary feature extraction and cost prediction before the optimizer makes its final decision. By pre-computing accurate cost estimates based on comprehensive join order characteristics, the system enables the optimizer to quickly select the best plan without sacrificing accuracy, thus improving overall query execution efficiency

Inventive Principle:
Principle #10Preliminary action

3Loss of information

If the feature extraction layer processes only basic join order information, then the processing is efficient, but it cannot learn comprehensive join order characteristics, leading to same representation for different join orders

Engineering Contradiction:
Improvejoin order information completenessVSAvoidneural network structure complexity
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The patent segments the feature extraction process into multiple specialized layers: table identifier extraction, join type identification, join condition analysis, and tree structure processing. Each layer focuses on specific aspects of join order information, ensuring comprehensive information capture while keeping each individual layer manageable in complexity

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent designs a universal neural network architecture that handles multiple types of join order information through shared components. The same network structure processes different join types, table configurations, and tree structures, reducing overall system complexity while maintaining comprehensive information extraction capabilities through its multi-functional design

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS12056125B2Database processing method and apparatus
Publication Date: 2024.08.06 HUAWEI TECH CO LTD
  • US12056125B2 patent drawing
  • US12056125B2 patent drawing
  • US12056125B2 patent drawing

AI summary

A database processing method and an apparatus are provided, and may be applied to a database system. A tree structure is used to represent a join order and used as an input of a neural network, and different first attribute matrices are allocated to different brother nodes in the input tree structure. This helps the neural network comprehensively learn information about the join order, obtain representation information capable of differentiating the join order from another join order, and predict costs of the join order accurately based on the obtained representation information of the join order. Then, an optimizer selects a join order with lowest costs for a query statement based on the costs predicted by a cost prediction module.