Query Plan Migration for Database Compatibility

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Database systems face challenges in optimizing query plan performance across different environments, such as from a test database to a production database, due to metadata differences and software version discrepancies, leading to suboptimal query execution times and resource utilization.

Innovation Solution

Implementing query plan migration functionality that allows for the import and export of query plans between source and target database systems, including metadata comparison and replacement to ensure compatibility, enabling accurate execution of captured query plans in different database systems.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If query plans are captured and migrated between database systems with different metadata, then query execution performance can be optimized, but metadata incompatibility prevents accurate execution

Engineering Contradiction:
Improvequery execution performanceVSAvoidquery plan compatibility
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system changes the metadata parameters of the captured query plan to match the target database system's schema. This includes updating table names, column names, and other metadata elements to ensure compatibility between the source and target environments while preserving the optimized query execution logic

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The system creates a copy of the captured query plan from the source database system and then adapts it for the target system. This allows the optimized execution logic to be replicated and reused across different environments while making necessary modifications for compatibility

Inventive Principle:
Principle #26Copying

2Manufacturing precision

If query plans are re-optimized in each database system, then local optimization is achieved, but execution time and resource consumption increase

Engineering Contradiction:
Improvequery optimization accuracyVSAvoidquery processing time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The system performs query optimization in advance in the source database system and captures the optimized query plan before execution. This preliminary optimization eliminates the need for re-optimization in the target system, saving time and computational resources while maintaining optimization quality

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The optimized query plan is designed to be universal and reusable across multiple database systems. Once optimized in one system, the same query plan can be migrated and executed in other systems with minimal modification, eliminating redundant optimization efforts

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

3Reliability

If test database systems are used to recreate production transactions, then regression analysis is enabled, but accurate resolution implementation becomes difficult

Engineering Contradiction:
Improveregression detection capabilityVSAvoidresolution implementation ease
Core Design Contradiction:
ReliabilityVSEase of manufacture

Solution Approach 1:

The system captures query plans from the production database system and copies them to the test database system. This ensures that the same optimized execution logic is present in both environments, allowing accurate regression testing and easy implementation of resolutions

Inventive Principle:
Principle #26Copying

Data Source

PatentUS11556538B2Query plan migration in database systems
Publication Date: 2023.01.17 SAP SE
  • US11556538B2 patent drawing
  • US11556538B2 patent drawing
  • US11556538B2 patent drawing

AI summary

Methods, systems, and computer-readable storage media for receiving, by a current database system, a query plan file representative of a captured query plan from a source database system, receiving, by the current database system, a set of definitions including one or more definitions, each definition in the set of definitions corresponding to an object that is implicated by the query plan, the object being included in a set of objects, and determining, by the current database system, that each definition in the set of definitions is identical to a respective definition of a corresponding object within the current database system, and in response: executing the captured query plan in the current database system to provide a query result.