Database Query Plan Embeddings for Scalable Semantic Equivalence Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing solutions for detecting equivalence in large-scale analytics engines are inadequate, as they either focus on syntactic level detection, lack generality, or suffer from scalability issues, leading to inefficiencies and computational bottlenecks.

Innovation Solution

The GEqO engine employs a series of equivalence filters, including a schema filter, vector matching filter, equivalence model filter, and automated verifier, to identify semantically equivalent subexpressions, leveraging machine learning and approximate nearest neighbor search to efficiently prune nonequivalent pairs before using an expensive formal verifier.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If existing equivalence detection solutions are used, then syntactic level detection is achieved, but semantic equivalence detection is insufficient

Engineering Contradiction:
Improveequivalence detection precisionVSAvoiddetection generality
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent replaces traditional syntactic parsing mechanisms with machine learning models (BERT, RoBERTa) that perform semantic understanding. The ML models process query plan trees and compute semantic similarity scores, enabling detection of semantically equivalent subexpressions even when syntactic structure differs. This substitution of mechanical parsing with intelligent semantic analysis resolves the contradiction between precision and generality.

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

Solution Approach 2:

The patent changes the detection parameter from syntactic similarity (exact match) to semantic similarity (meaning equivalence). By transforming query plan trees into vector representations and comparing them using cosine similarity or other semantic distance metrics, the system detects equivalence based on semantic meaning rather than structural identity, achieving both precision and adaptability.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If comprehensive equivalence detection is performed, then detection accuracy is improved, but computational complexity increases

Engineering Contradiction:
Improveequivalence detection accuracyVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the equivalence detection process into multiple independent stages: (1) extracting subexpressions from queries, (2) representing them as query plan trees, (3) converting trees to vector representations, (4) computing semantic similarity scores, and (5) filtering based on threshold. This segmentation allows each stage to be optimized independently and enables early rejection of non-equivalent pairs, reducing overall computational complexity while maintaining accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary actions by pre-processing query plans into standardized vector representations before equivalence comparison. The machine learning models are pre-trained on semantic understanding, so during actual detection, only lightweight vector similarity computations are needed. This preliminary preparation significantly reduces the computational burden of comprehensive equivalence detection.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If all subexpression pairs are verified, then detection completeness is achieved, but execution time increases

Engineering Contradiction:
Improvedetection completenessVSAvoidexecution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies partial action by using machine learning models to quickly assess semantic similarity and only performing comprehensive verification on pairs that meet certain criteria. The system computes semantic similarity scores for all pairs but uses threshold-based filtering to identify candidates for deeper analysis, achieving detection completeness for relevant pairs while avoiding unnecessary verification time for obviously non-equivalent pairs.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent implements feedback mechanisms where the semantic similarity scores from machine learning models feed back into the filtering decision process. Pairs with high similarity scores are prioritized for verification, while low-score pairs are filtered out. This feedback loop continuously optimizes the verification process, maintaining completeness for true equivalents while dramatically reducing execution time by avoiding unnecessary verifications.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12436950B1Machine learning accelerated semantic equivalence detection
Publication Date: 2025.10.07 MICROSOFT TECHNOLOGY LICENSING LLC
  • US12436950B1 patent drawing
  • US12436950B1 patent drawing
  • US12436950B1 patent drawing

AI summary

Examples detect equivalent subexpressions within a computational workload. Examples include converting a query plan tree associated with a first subexpression into a matrix. The first subexpression is a portion of a database query from the computational workload. Each node in the query plan tree is represented as a row of the matrix. The matrix is converted into a first vector. The first subexpression is determined to be equivalent to a second subexpression by comparing the first vector to a second vector associated with the second subexpression. The comparison includes computing a distance between the first and second vectors that is lower than a distance threshold. The computational workload is modified, based on the determining, to perform the first subexpression and exclude performance of the second subexpression as duplicative.