Database Driver Query Union and Split

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Enterprise applications face inefficiencies due to the high number of queries sent to databases, particularly when multiple execution threads send almost identical queries, leading to bottlenecks in query processing.

Innovation Solution

A database driver generates a union query based on similar queries from different execution threads, which is submitted to the database, and the combined result set is used to satisfy each individual query, reducing the number of communications and processing load.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If multiple execution threads send identical queries to the database, then each thread can obtain its required data, but the number of queries to the database increases causing processing bottlenecks

Engineering Contradiction:
Improvedata retrieval completenessVSAvoidquery processing throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent merges multiple identical or similar queries from different execution threads into a single unified query. The database driver detects when multiple threads are waiting for the same data and combines their requests, sending one query to the database instead of multiple separate queries. This reduces the query processing load on the database while ensuring all threads receive their required data through the shared result set.

Inventive Principle:
Principle #5Merging (Combining)

2Productivity

If the database driver waits for queries to be sent at the exact same moment to consolidate them, then query consolidation can occur, but timing synchronization becomes complex and may cause delays

Engineering Contradiction:
Improvequery consolidation efficiencyVSAvoidquery processing delay
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The database driver performs preliminary actions by pre-compiling and caching the SQL statements of waiting execution threads. When similar queries are detected, the driver has already prepared the query structures in advance, allowing for rapid consolidation and execution without requiring complex real-time synchronization. This preliminary preparation reduces the timing complexity and minimizes delays.

Inventive Principle:
Principle #10Preliminary action

3Device complexity

If the database processes each query independently, then query processing is simple and straightforward, but the same data is retrieved multiple times wasting resources

Engineering Contradiction:
Improvequery processing complexityVSAvoiddatabase processing energy
Core Design Contradiction:
Device complexityVSLoss of energy

Solution Approach 1:

Instead of having the database process each query independently, the patent creates a single query result set that is then copied and distributed to multiple execution threads. The database driver retrieves the data once from the database and creates separate result set copies for each thread that requested the same data. This approach maintains simple database processing while eliminating redundant data retrieval and reducing energy consumption.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS9934275B2Query union and split
Publication Date: 2018.04.03 RED HAT INC
  • US9934275B2 patent drawing
  • US9934275B2 patent drawing
  • US9934275B2 patent drawing

AI summary

An example method of processing a plurality of queries includes determining, at a database driver, that a first query and a second query are similar. The first query is sent from a first execution thread executing in an application server. The method also includes generating, at the database driver, a union query based on the first and second queries. The method further includes submitting the union query to a database that stores database tables from which data is selected based on the first and second queries. The method also includes receiving a combined result set of the union query from the database and submitting the first query against the combined result set. The method further includes receiving, at the database driver, a first result set of the first query in response to submitting the first query against the combined result set.