Interactive SQL Query Grouping Using Bitwise Summaries and LSH

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Identifying similar SQL queries in large databases with tens of millions of queries is challenging due to the difficulty in analyzing vast amounts of data and determining exact or similar queries efficiently.

Innovation Solution

A distributed computing methodology using bitwise summaries and Locally Sensitive Hashing (LSH) algorithms to represent SQL queries as binary vectors, enabling fast and interactive comparison of queries based on user-defined similarity criteria, with techniques like MinHash and LSH to reduce computational complexity and identify groupings of similar queries.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional SQL query analysis methods are used on large databases, then query similarity can be identified, but the computational time and resources required become prohibitively large when dealing with tens of millions of queries

Engineering Contradiction:
Improvequery similarity identification accuracyVSAvoidcomputational time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent segments the large-scale query analysis problem into smaller manageable units by dividing queries into equivalence classes based on their structural characteristics. This segmentation allows the system to process and compare queries in groups rather than individually, significantly reducing the computational complexity and time required to identify similar queries across tens of millions of database queries.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transforms SQL queries into a standardized parameterized form by identifying and replacing literal values with parameters. This parameterization changes the representation of queries from their original text form to a structured form with placeholders, enabling efficient comparison and grouping of semantically similar queries while reducing the impact of value differences on similarity assessment.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If exact duplicate detection is performed on all queries, then precise identification of identical queries is achieved, but the system cannot efficiently handle the scale of tens of millions of queries interactively

Engineering Contradiction:
Improveduplicate detection accuracyVSAvoidquery processing throughput
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent replaces the mechanical approach of exact string matching with a more sophisticated system based on query equivalence class identification. Instead of performing exhaustive pairwise comparisons, the system uses structural analysis and parameterization to group queries into equivalence classes, then identifies similar queries within these classes, dramatically improving processing throughput while maintaining detection accuracy.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent performs preliminary actions by pre-processing queries into equivalence classes and parameterized forms before the actual similarity search. This preliminary organization of queries into structured groups allows the system to quickly narrow down candidate matches and perform efficient comparisons only within relevant groups, rather than across all queries, thereby enhancing productivity.

Inventive Principle:
Principle #10Preliminary action

3Loss of information

If comprehensive query analysis is performed to understand all query patterns, then deep insights into data access patterns are gained, but the computational overhead becomes too large for interactive use

Engineering Contradiction:
Improvedata access pattern information retentionVSAvoidcomputational overhead
Core Design Contradiction:
Loss of informationVSUse of energy by moving object

Solution Approach 1:

The patent extracts essential structural characteristics and patterns from SQL queries by identifying equivalence classes and parameterized forms. This extraction process separates the critical information needed for pattern recognition (query structure, table relationships, operation types) from non-essential details (specific literal values, formatting), allowing comprehensive pattern analysis to be performed on a reduced representation that consumes far less computational energy.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent performs preliminary analysis to organize queries into equivalence classes and extract their structural parameters before conducting detailed pattern analysis. This preliminary structuring enables the system to efficiently identify and analyze data access patterns across large query sets without the computational overhead of analyzing every query in full detail, making interactive comprehensive analysis feasible.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12517916B2Interactive identification of similar SQL queries
Publication Date: 2026.01.06 CLOUDERA INC
  • US12517916B2 patent drawing
  • US12517916B2 patent drawing
  • US12517916B2 patent drawing

AI summary

Systems and methods for very fast grouping of “similar” SQL queries according to user-supplied similarity criteria. The user-supplied similarity criteria include a threshold quantifying the degree of similarity between SQL queries and common artifacts included in the queries. A similarity-characterizing data structure allows for the very fast grouping of “similar” SQL queries. Because the computation is distributed among multiple compute nodes, a small cluster of compute nodes takes a short time to compute the similarity-characterizing data on a workload of tens of millions of queries. The user can supply the similarity criteria through a UI or a command line tool. Furthermore, the user can adjust the degree of similarity by supplying new similarity criteria. Accordingly, the system can display in real time or near real time, updated SQL groupings corresponding to the newly supplied similarity criteria using the originally computed similarity-characterizing data structure.