Query Optimizer Accuracy Testing via Rank Correlation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
There is no standard framework to objectively measure and compare the accuracy of query optimizers across different database systems, leading to inefficiencies in system performance and increased operational costs due to inaccurate optimization results.
Innovation Solution
A stand-alone testing system, referred to as TAQO, generates multiple alternative query plans using optimizer switches, measures actual execution times, and computes a correlation metric between estimated and actual costs to provide an accuracy score, using a modified Kendall Tau rank correlation metric to assess the optimizer's ability to order plans correctly.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If cost-based optimization is used to improve query performance, then system performance is improved, but accuracy of cost estimation becomes critical and difficult to measure
Solution Approach 1:
The patent introduces an intermediary testing framework that acts as a mediator between the query optimizer and the measurement process. This framework provides standardized test queries, collects execution times, and computes accuracy metrics (such as RMSE and R²) to objectively measure optimizer accuracy without interfering with normal query performance optimization.
Solution Approach 2:
The patent creates a separate testing environment that copies the essential components needed for optimizer evaluation. It uses test queries that replicate real-world scenarios and generates synthetic cost estimates to compare against actual execution times, allowing accurate measurement without affecting production system performance.
2Loss of energy
If optimizer accuracy is improved to reduce operational costs, then total cost of ownership is reduced, but objective comparison across different database systems is currently impossible
Solution Approach 1:
The patent creates a universal testing framework that can evaluate optimizers across different database systems using the same standardized approach. The framework is designed to work with multiple database systems simultaneously, providing a common basis for comparison through standardized test queries, measurement metrics, and accuracy calculation methods.
Solution Approach 2:
The patent changes the measurement parameters from system-specific internal metrics to standardized external metrics that can be compared across systems. It introduces parameters such as root mean square error (RMSE) and coefficient of determination (R²) that transform qualitative optimizer performance into quantitative, comparable accuracy measurements.
3Productivity
If system-specific optimization results are used to achieve optimal performance for each system, then query execution is optimized, but standard testing and objective comparison become impossible
Solution Approach 1:
The patent segments the evaluation process into distinct components: test query generation, execution time collection, cost estimation extraction, and accuracy calculation. This segmentation allows the framework to maintain system-specific optimization while applying standardized measurement procedures to each component independently, enabling both optimized execution and objective comparison.
Data Source
AI summary
Query optimizer accuracy is tested by measuring the actual execution times on a database of each of a plurality of alternative query plans for each of a plurality of queries, first ranking the plans by the actual execution times, then ranking the plans by estimated execution times, and correlating the two rankings by computing a rank correlation metric. The rank correlation metric is normalized so that different optimizers can be objectively compared.


