LLM Query Optimizer for Automatic Database Execution Planning

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Developing and executing data queries against large-scale datasets in distributed database systems is complex and time-consuming, requiring trial-and-error approaches and manual parameter tuning, which adds complexity and burden to the code development process.

Innovation Solution

A large language model-based data query optimizer that accepts programming code as input, analyzes it to determine execution strategies, and generates optimized instructions for query execution, including hierarchical ordering and optimization techniques to improve performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If developers manually tune parameters to optimize query execution, then query execution performance is improved, but development time and complexity increase

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

Solution Approach 1:

The system enables self-service optimization where the query execution engine automatically analyzes query characteristics, data distribution, and system state to generate optimized execution plans without developer intervention. The engine performs self-tuning of parameters and adaptive optimization, eliminating the need for manual parameter adjustment while maintaining high query performance.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system implements feedback mechanisms where execution results, performance metrics, and system state information are continuously monitored and fed back to the optimization engine. This feedback loop enables automatic adjustment of query execution parameters and strategies based on actual performance data, allowing the system to learn and improve over time without additional developer input.

Inventive Principle:
Principle #23Feedback

2Productivity

If developers manually tune parameters to optimize query execution, then query execution performance is improved, but operational complexity increases

Engineering Contradiction:
Improvequery execution performanceVSAvoidoperational complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The query execution engine performs automatic parameter optimization and execution plan generation without requiring developer expertise in performance tuning. The system encapsulates complex optimization logic within the engine, presenting a simplified interface to developers while automatically handling parameter adjustment, execution strategy selection, and performance optimization.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The optimization engine acts as an intermediary between the query interface and the execution engine, translating high-level query requests into optimized execution plans. This intermediary layer handles the complexity of parameter tuning, data distribution analysis, and execution strategy selection, shielding developers from operational complexity while delivering optimized query performance.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If trial-and-error approach is used to identify optimal parameters, then query execution performance is improved, but time consumption increases

Engineering Contradiction:
Improvequery execution performanceVSAvoidtime consumption
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system performs preliminary analysis of query characteristics, data distribution, and system state before query execution to pre-determine optimal execution parameters and strategies. By conducting this analysis in advance rather than through trial-and-error during execution, the system eliminates iterative testing time while ensuring optimal performance from the first execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system implements real-time feedback mechanisms that monitor query execution performance and automatically adjust parameters based on observed results. This continuous feedback loop replaces the traditional trial-and-error approach by systematically learning from each execution and making data-driven optimizations, significantly reducing the time needed to identify optimal parameters.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12579139B2Large language model-based data query optimization
Publication Date: 2026.03.17 PAYPAL INC
  • US12579139B2 patent drawing
  • US12579139B2 patent drawing
  • US12579139B2 patent drawing

AI summary

Methods and systems are presented for providing a large language model-based query optimizer to interface between program developers and database systems. The query optimizer receives programming code corresponding to a set of queries intended for a database system from a program developer. The query optimizer then uses a machine learning model to analyze the programming code and to determine a set of strategies for executing the set of data queries corresponding to the programming code. To determine the set of strategies, the machine learning model analyzes dependencies among the set of data queries and retrieves sample data from the database system. The machine learning model implement the set of strategies by incorporating additional instructions in the programming code for the database system such that the database system would execute the set of data queries according to the set of strategies.