Inference Query Execution Using Unified DB-ML Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing systems face challenges in efficiently executing inference queries in database management systems by integrating machine learning models, leading to high resource consumption and latency, while maintaining data security and privacy.

Innovation Solution

A system that generates a unified intermediate representation (UIR) of inference queries and machine learning models, allowing cross-optimization between database and machine learning operators, with portions executed by respective engines to optimize resource usage and accuracy.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If machine learning models are integrated into database management systems to execute inference queries, then query accuracy and insights are improved, but resource consumption and latency increase

Engineering Contradiction:
Improvequery accuracyVSAvoidresource consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The system segments the inference query execution into distinct components: database operators for data retrieval and machine learning operators for model inference. This segmentation allows each component to be optimized independently and executed by specialized engines, reducing overall resource consumption while maintaining query accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system dynamically determines which portions of the unified intermediate representation to execute using the database engine versus the machine learning engine based on cross-optimization analysis. This dynamic allocation optimizes resource usage by assigning each operation to the most efficient executor, reducing overall resource consumption while maintaining accuracy.

Inventive Principle:
Principle #15Dynamics

2Measurement precision

If machine learning models are integrated into database management systems, then query accuracy is improved, but execution latency increases

Engineering Contradiction:
Improvequery accuracyVSAvoidexecution latency
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary actions by generating a unified intermediate representation that captures both database and machine learning operators before execution. Cross-optimization is performed in advance to determine the optimal execution plan, which reduces execution latency during actual query processing by avoiding runtime decision-making.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system dynamically selects execution strategies and optimizes the unified intermediate representation based on the specific query and model characteristics. This dynamic optimization reduces execution latency by choosing the most efficient path for each inference query while maintaining accuracy.

Inventive Principle:
Principle #15Dynamics

3Use of energy by moving object

If inference queries are executed using traditional database engines alone, then resource consumption is lower, but query accuracy and machine learning insights are lost

Engineering Contradiction:
Improveresource consumptionVSAvoidquery accuracy
Core Design Contradiction:
Use of energy by moving objectVSMeasurement precision

Solution Approach 1:

The system merges database operators and machine learning operators into a unified intermediate representation that can be executed by coordinating both database and machine learning engines. This merging enables the system to leverage the strengths of both engines, achieving high query accuracy with optimized resource consumption by executing only necessary operations in each engine.

Inventive Principle:
Principle #5Merging (Combining)

4Use of energy by moving object

If cross-optimization between database and machine learning operators is performed, then resource consumption and latency are reduced, but system complexity increases

Engineering Contradiction:
Improveresource consumptionVSAvoidsystem complexity
Core Design Contradiction:
Use of energy by moving objectVSDevice complexity

Solution Approach 1:

The unified intermediate representation serves as an intermediary that bridges database operators and machine learning operators. This intermediary enables cross-optimization between the two systems without requiring direct complex interactions, reducing system complexity while still achieving optimized resource consumption and latency.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentEP4052185B1Query processing with machine learning
Publication Date: 2026.01.28 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP4052185B1 patent drawingFigure 1A
  • EP4052185B1 patent drawingFigure 1B
  • EP4052185B1 patent drawingFigure 1C

AI summary

The description relates to executing an inference query relative to a database management system, such as a relational database management system. In one example a trained machine learning model can be stored within the database management system. An inference query can be received that applies the trained machine learning model on data local to the database management system. Analysis can be performed on the inference query and the trained machine learning model to generate a unified intermediate representation of the inference query and the trained model. Cross optimization can be performed on the unified intermediate representation. Based upon the cross-optimization, a first portion of the unified intermediate representation to be executed by a database engine of the database management system can be determined, and, a second portion of the unified intermediate representation to be executed by a machine learning runtime can be determined.