# US 2026/0099503 A1 · Interactive identification of similar sql queries

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0099503 A1
- Document ID: US20260099503A1
- Status: Published application
- Kind: A1
- Application number: 19/406,046
- Filed: 2025-12-02
- Published: 2026-04-09
- Earliest claimed: 2016-04-22
- Assignees: Cloudera, Inc.
- Applicants: Cloudera, Inc.
- Inventors: Rituparna Agrawal; Anupam Singh; Prithviraj Pandian
- Web page: https://patentgrep.com/patent/US20260099503A1

## CPC

- G06F 16/248: Presentation of query results
- G06F 16/211: {Schema design and management}
- G06F 16/2455: Query execution
- G06F 16/285: {Clustering or classification}
- G06F 16/86: {Mapping to a database}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

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.

## Claims

### Claim 1

A method comprising:
receiving, by one or more processors of a database system, a database query from a first user, wherein the database query is a request to retrieve data from a database, wherein the database query includes a set of query artifacts, and wherein each query artifact in the set of query artifacts is an instruction to retrieve a particular subset of data from the database;
receiving, by the one or more processors of the database system, a plurality of similarity criteria from a second user, wherein each similarity criteria includes (i) a query artifact from the set of query artifacts and (ii) a similarity threshold corresponding to the query artifact, wherein the similarity threshold is a percentage specified by the second user, and wherein database queries sharing a percentage of a vector representation of the query artifact greater than or equal to the similarity threshold are considered similar;
determining, by the one or more processors of the database system, a group of similar database queries out of a collection of database queries for at least one of the plurality of similarity criteria,
wherein the group of similar database queries for a given similarity criteria is determined based on applying a locally sensitive hashing (LSH) algorithm across a plurality of first data structures to produce a second data structure that indicates the group of similar database queries for the given similarity criteria; and
providing, by the one or more processors of the database system, to the second user, an interactive display that (i) indicates the group of similar database queries for each of the plurality of similarity criteria and (ii) enables the second user to increase or decrease the similarity threshold corresponding to the query artifact.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
identifying possible artifact-threshold combinations for the collection of database queries based on the plurality of first data structures; and
generating the plurality of first data structures based on generating a symmetric binary matrix for each of the possible artifact-threshold combinations identified for the collection of database queries.

### Claim 3 (depends on 2)

The method of claim 2, wherein generating the symmetric binary matrix for a given possible artifact-threshold combination comprises:
determining that a hash of a first database query and a hash of a second database query collide into a common hash bucket corresponding to the given possible artifact-threshold combination; and
setting a binary value of the symmetric binary matrix that intersects the first database query and the second database query to indicate that the first database query and the second database query are similar with respect to the given possible artifact-threshold combination.

### Claim 4 (depends on 2)

The method of claim 2, wherein the plurality of first data structures is pre-computed by a plurality of distributed compute nodes of the database system performing a hashing of the collection of database queries in parallel.

### Claim 5 (depends on 1)

The method of claim 1, wherein the query artifact is a keyword defined in Structure Query Language (SQL).

### Claim 6 (depends on 1)

The method of claim 1, wherein the interactive display is provided to the second user via a web server of the database system.

### Claim 7 (depends on 1)

The method of claim 1, wherein the collection of database queries are defined in database logs stored in an object store of the database system.

### Claim 8

A database system comprising:
at least one processor; and
at least one memory coupled to the at least one processor, the at least one memory having instructions stored thereon which, when executed by the at least one processor, cause the database system to:
receive a database query from a first user, wherein the database query is a request to retrieve data from a database, wherein the database query includes a set of query artifacts, and wherein each query artifact in the set of query artifacts is an instruction to retrieve a particular subset of data from the database;
receive a plurality of similarity criteria from a second user, wherein each similarity criteria indicates (i) a query artifact from the set of query artifacts and (ii) a similarity threshold corresponding to the query artifact, wherein the similarity threshold is a percentage specified by the second user, and wherein database queries sharing a percentage of a vector representation of the query artifact greater than or equal to the similarity threshold are considered similar;
determine, for at least one of the plurality of similarity criteria, a group of similar database queries out of a collection of database queries,
wherein the group of similar database queries for a given similarity criteria is determined based on applying a locally sensitive hashing (LSH) algorithm across a plurality of first data structures; and
provide, to the second user, a display that indicates the group of similar database queries for each of the plurality of similarity criteria.

### Claim 9 (depends on 8)

The database system of claim 8, wherein the instructions further cause the database system to:
identify possible artifact-threshold combinations for the collection of database queries based on the plurality of first data structures; and
generate the plurality of first data structures based on generating a symmetric binary matrix for each of the possible artifact-threshold combinations identified for the collection of database queries.

### Claim 10 (depends on 9)

The database system of claim 9, wherein the database system being caused to generate the symmetric binary matrix for a given possible artifact-threshold combination comprises the database system being caused to:
determine that a hash of a first database query and a hash of a second database query collide into a common hash bucket corresponding to the given possible artifact-threshold combination; and
set a binary value of the symmetric binary matrix that intersects the first database query and the second database query to indicate that the first database query and the second database query are similar with respect to the given possible artifact-threshold combination.

### Claim 11 (depends on 9)

The database system of claim 9, wherein the plurality of first data structures is pre-computed by a plurality of distributed compute nodes of the database system performing a hashing of the collection of database queries in parallel.

### Claim 12 (depends on 8)

The database system of claim 8, wherein the query artifact is a keyword defined according Structure Query Language (SQL).

### Claim 13 (depends on 8)

The database system of claim 8, wherein the display is an interactive display provided to the second user via a web server of the database system.

### Claim 14 (depends on 8)

The database system of claim 8, wherein the collection of database queries are defined in database logs stored in an object store of the database system.

### Claim 15

At least one non-transitory computer-readable medium storing instructions, execution of which in a computer system causes the computer system to perform operations comprising:
receiving a database query from a first user, wherein the database query is a request to retrieve data from a database, wherein the database query includes a set of query artifacts, and wherein each query artifact in the set of query artifacts is an instruction to retrieve a particular subset of data from the database;
receiving a plurality of similarity criteria from a second user, wherein each similarity criteria indicates (i) a query artifact from the set of query artifacts and (ii) a similarity threshold corresponding to the query artifact, wherein the similarity threshold is a percentage specified by the second user, and wherein database queries sharing a percentage of a vector representation of the query artifact greater than or equal to the similarity threshold are considered similar;
determining, for at least one of the plurality of similarity criteria, a group of similar database queries out of a collection of database queries,
wherein the group of similar database queries for a given similarity criteria is determined based on applying a bitwise operation across a plurality of first data structures; and
providing, to the second user, an interactive display that indicates the group of similar database queries for each of the plurality of similarity criteria.

### Claim 16 (depends on 15)

The at least one non-transitory computer-readable medium of claim 15, wherein the operations performed by the computer system further comprise:
identifying possible artifact-threshold combinations for the collection of database queries based on the plurality of first data structures; and
generating the plurality of first data structures based on generating a symmetric binary matrix for each of the possible artifact-threshold combinations identified for the collection of database queries.

### Claim 17 (depends on 16)

The at least one non-transitory computer-readable medium of claim 16, wherein generating the symmetric binary matrix for a given possible artifact-threshold combination comprises:
determining that a hash of a first database query and a hash of a second database query collide into a common hash bucket corresponding to the given possible artifact-threshold combination; and
setting a binary value of the symmetric binary matrix that intersects the first database query and the second database query to indicate that the first database query and the second database query are similar with respect to the given possible artifact-threshold combination.

### Claim 18 (depends on 16)

The at least one non-transitory computer-readable medium of claim 16, wherein the plurality of first data structures is pre-computed by a plurality of distributed compute nodes of the computer system performing a hashing of the collection of database queries in parallel.

### Claim 19 (depends on 15)

The at least one non-transitory computer-readable medium of claim 15, wherein the interactive display is provided to the second user via a web server of the computer system.

### Claim 20 (depends on 15)

The at least one non-transitory computer-readable medium of claim 15, wherein the collection of database queries are defined in database logs stored in an object store of the computer system.
