Database Query Tool Optimizing SQL Execution via Historical Similarity

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Users often submit sub-optimal database queries due to the complexity of SQL and changing resource demands, leading to inefficient resource usage.

Innovation Solution

A database tool that groups similar historical queries by similarity and ranks them based on static and dynamic features, suggesting optimized queries to users and prioritizing resource usage.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If users write queries in SQL, then data can be accessed from the database, but the queries become sub-optimal due to complexity and resource demands

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidquery construction complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system introduces an intermediary component that acts as a mediator between the user's sub-optimal query and the database execution. This intermediary analyzes the query, compares it with historical queries using cosine similarity, and automatically generates or selects an optimized version, thereby resolving the complexity issue while maintaining productivity

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs preliminary actions by pre-processing and storing historical queries with their optimization patterns before new queries arrive. When a user submits a query, the system has already prepared similarity comparisons and optimization strategies based on past data, enabling faster optimization without adding real-time complexity to the user's workflow

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If multiple users access the database simultaneously, then data access capacity increases, but query optimality decreases due to competing resource demands

Engineering Contradiction:
Improveconcurrent access capabilityVSAvoidquery execution efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The system applies dynamics by continuously re-ranking historical queries based on current system resource conditions. As multiple users access the database simultaneously, the system dynamically adjusts the optimization strategy by re-evaluating which historical queries are most similar and re-ranking them according to current resource availability, maintaining query optimality despite changing concurrent access patterns

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system implements feedback mechanisms by monitoring resource usage patterns from concurrent users and using this information to adjust query optimization. The system collects feedback on actual query performance and resource consumption, then uses this feedback to improve future query rankings and optimizations, adapting to the dynamic multi-user environment

Inventive Principle:
Principle #23Feedback

3Measurement precision

If the database tool searches all historical queries for similarity, then accurate query optimization is achieved, but search time increases

Engineering Contradiction:
Improvequery similarity accuracyVSAvoidsearch time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system applies segmentation by dividing the historical query set into manageable segments or groups. Instead of comparing a new query against every single historical query, the system segments the search space using techniques like cosine similarity thresholds and hierarchical clustering, allowing accurate similarity measurement while significantly reducing the time required by limiting comparisons to relevant segments

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11269899B2Database query tool
Publication Date: 2022.03.08 BANK OF AMERICA CORP
  • US11269899B2 patent drawing
  • US11269899B2 patent drawing
  • US11269899B2 patent drawing

AI summary

A memory stores a first log and a collection of queries. A processor accesses a second log that includes a first, second, third and fourth historical query, determines that the first and second historical queries belong to a first similarity group and the third and fourth historical queries belong to a second similarity group, and ranks the queries within groups based on static and dynamic features. The processor further determines the third historical query is frequently submitted and copies the highest ranked similar queries into the collection. The processor receives a first database query, stores it in both logs, determines it is not similar to queries stored in memory, further determines that it belongs to the first similarity group, copies the highest ranked similar queries to the first log, and returns a report containing the similar queries. The processor further receives and executes a second query selected from the report.