Database Query Optimizer Tuning via Tolerance Fingerprints
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database query optimizers may not always select the most efficient query plan for execution, especially in dynamic and automatically generated query statements, leading to suboptimal performance in terms of memory allocation and processing time.
Innovation Solution
Implementing a system where a tolerance level and specific query statement are used to generate fingerprints, allowing the optimizer to apply tuning parameters to future query statements through fingerprint matching, enabling efficient query plan selection by experienced users.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a query optimizer automatically selects query plans without user input, then the system operates with high automation, but the query execution performance may be suboptimal due to inability to apply expert tuning knowledge
Solution Approach 1:
The system allows experienced users to self-service by providing tuning parameters and tolerance levels that the optimizer then applies automatically. The optimizer serves itself by learning from user-provided examples and applying those tuning parameters to similar future queries without requiring direct user intervention for each query.
Solution Approach 2:
The system incorporates feedback mechanisms where user-provided tuning parameters and tolerance levels are used to generate fingerprints that guide future query optimizations. The optimizer learns from the feedback of user expertise and continuously improves its query plan selection based on this accumulated knowledge.
2Measurement precision
If the optimizer applies strict fingerprint matching with zero tolerance, then the precision of query statement matching is high, but the adaptability to dynamically generated query variations is reduced
Solution Approach 1:
The system dynamically adjusts the matching criteria by incorporating tolerance levels that allow for variations in query statements. The fingerprint generation process is dynamic, accommodating different levels of query statement variations while maintaining meaningful matching capabilities.
Solution Approach 2:
The system changes the parameter of tolerance level to balance between matching precision and adaptability. By adjusting the tolerance level parameter, the system can adapt to different query statement variations while maintaining the ability to apply appropriate tuning parameters based on the degree of similarity.
3Manufacturing precision
If the system processes each query statement individually without generalization, then the manufacturing precision of query optimization is high, but the productivity decreases due to repeated analysis of similar queries
Solution Approach 1:
The system creates copies of tuning parameters and their associated fingerprints from user-provided examples. Instead of re-analyzing similar queries individually, the optimizer copies the learned tuning parameters and applies them to matching queries, significantly improving throughput while maintaining optimization quality.
Solution Approach 2:
The system performs preliminary action by pre-processing user-provided query examples to generate fingerprints and extract tuning parameters in advance. This preliminary analysis allows the optimizer to quickly match future queries against the pre-processed knowledge base without repeating the full analysis process.
4Adaptability or versatility
If the system implements tolerance level-based fingerprint generation, then the adaptability to query variations is improved, but the device complexity increases due to additional processing steps
Solution Approach 1:
The fingerprint generation process is segmented into distinct steps: normalizing the query statement, generating the fingerprint based on the normalized statement and tolerance level, and then matching against stored fingerprints. This segmentation makes the complex process more manageable and efficient.
Solution Approach 2:
The tolerance level acts as an intermediary parameter that mediates between the query statement and the fingerprint generation process. It provides a controlled interface for handling query variations without requiring complex processing logic throughout the entire system.
Data Source
AI summary
An input is accessed representing a tuning parameter for a first query statement and a tolerance level. The tolerance level represents a degree of acceptable discrepancy between the first query statement and another query statement. A first fingerprint is generated for the first query statement based on a content of the first query statement and the tolerance level; and the first fingerprint and the tuning parameter are stored. The first fingerprint is used as an index for an optimizer to associate the tuning parameter with a second query statement that corresponds to the first fingerprint.


