Auxiliary Query Optimizer for Query Plan Search Bottlenecks
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Modern database systems face challenges in optimizing complex queries due to the exponential growth of potential query plans, leading to performance issues and computational constraints, making it difficult to change query optimizers without causing performance degradation.
Innovation Solution
An auxiliary query optimization framework that utilizes one or more auxiliary query optimizers to generate optimized query plans, which can be evaluated for performance efficiency and potentially replace or modify inline query optimizers, allowing for more thorough optimization without degrading performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Manufacturing precision
If the query optimizer evaluates more potential query plans to improve optimization quality, then the query plan quality is improved, but the optimization time increases exponentially
Solution Approach 1:
The query optimization process is divided into two independent segments: an auxiliary query optimizer that generates optimized query plans without time constraints, and an inline query optimizer that handles production queries. This segmentation allows thorough optimization in the auxiliary optimizer while maintaining fast response in the inline optimizer, resolving the contradiction between optimization quality and optimization time.
Solution Approach 2:
The auxiliary query optimizer performs preliminary optimization work by generating optimized query plans in advance, before production queries are executed. These pre-generated optimized plans are then used by the inline query optimizer, allowing the system to benefit from thorough optimization without incurring the time cost during production query execution.
2Productivity
If the inline query optimizer is modified to improve query performance, then query execution efficiency is improved, but performance regression risk increases
Solution Approach 1:
The auxiliary query optimizer serves as an intermediary that generates optimized query plans independently. These plans are then evaluated and selectively applied by the inline query optimizer. This intermediary approach allows performance improvements to be tested and validated before being adopted, reducing the risk of performance regression while still enabling efficiency improvements.
Solution Approach 2:
The system implements feedback mechanisms where query execution results are monitored and used to evaluate the effectiveness of optimized query plans. This feedback loop allows the system to identify successful optimizations and discard unsuccessful ones, ensuring that only performance-improving changes are retained, thus maintaining performance stability while improving efficiency.
3Adaptability or versatility
If the query optimizer considers more query operations and table combinations, then the comprehensiveness of optimization is improved, but the search space expands exponentially
Solution Approach 1:
The optimization task is segmented between the auxiliary query optimizer, which handles comprehensive exploration of the search space without constraints, and the inline query optimizer, which handles production queries with time constraints. This segmentation allows the system to maintain comprehensive optimization capability while managing the complexity of the search space effectively.
Solution Approach 2:
The auxiliary query optimizer creates optimized copies of query plans that can be reused by the inline query optimizer. Instead of re-exploring the entire search space for each production query, the system uses pre-generated optimized plans as copies, significantly reducing the effective search space while maintaining optimization comprehensiveness.
Data Source
AI summary
Techniques and solutions are provided for improved query optimization, including for sub-portions of a query plan. A query is submitted to an inline query optimizer and at least one auxiliary query optimizer. The query is optimized by the inline query optimizer and the auxiliary query optimizer. A query processor can evaluate costs associated with query plans produced by the inline query optimizer and the auxiliary query optimizer and select a plan for execution that is most performant.


