# US 2026/0064679 A1 · System and method for batching database queries

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

- Number: US 2026/0064679 A1
- Document ID: US20260064679A1
- Status: Published application
- Kind: A1
- Application number: 19/300,969
- Filed: 2025-08-15
- Published: 2026-03-05
- Earliest claimed: 2024-08-30
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Hui LI
- Web page: https://patentgrep.com/patent/US20260064679A1

## CPC

- G06F 16/24535: {of sub-queries or views}
- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06F 11/3409: {for performance assessment}
- G06F 16/2386: {Bulk updating operations (data conversion details G06F16/258)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods include reception of a plurality of database queries, determination of a first set of database queries from the plurality of database queries, where each of the first set of database queries requests data from a same database table, and where a total count of returned records for the first set of database queries is less than a threshold, merge of the first set of database queries into a batch query, transmission of the batch query to a database, reception of a batch query result set from the database, determination, for each of the first set of database queries, of a result set from the batch query result set, and return of the result sets for each of the first set of database queries.

## Claims

### Claim 1

A system comprising:
a memory storing executable program code; and
one or more processing units to execute the executable program code to cause the system to:
receive a plurality of database queries;
determine a first set of database queries from the plurality of database queries, where each of the first set of database queries requests data from a same database table, and where a total count of returned records for the first set of database queries is less than a threshold;
merge the first set of database queries into a batch query;
transmit the batch query to a database;
receive a batch query result set from the database;
for each of the first set of database queries, determine a result set from the batch query result set; and
return the result sets for each of the first set of database queries.

### Claim 2 (depends on 1)

The system of claim 1, wherein a first one of the first set of database queries is associated with a first database schema and wherein a second one of the first set of database queries is associated with a second database schema.

### Claim 3 (depends on 2)

The system of claim 2, wherein a third one of the first set of database queries requests data from a first one or more columns of the database table and a fourth one of the first set of database queries requests data from a second one or more columns of the database table.

### Claim 4 (depends on 1)

The system of claim 1, wherein the batch query includes a subclause respectively associated with each of the first set of database queries, and each subclause defines a query identifier column populated with an identifier of its respective database query.

### Claim 5 (depends on 1)

The system of claim 1, wherein a first one of the first set of database queries requests data from a first one or more columns of the database table and a second one of the first set of database queries requests data from a second one or more columns of the database table.

### Claim 6 (depends on 5)

The system of claim 5, wherein the batch query includes a subclause respectively associated with each of the first set of database queries, wherein a subclause associated with the first one of the first set of database queries defines NULL fields for ones of the second one or more columns which are not in the first one or more columns, and wherein a subclause associated with the second one of the first set of database queries defines NULL fields for ones of the first one or more columns which are not in the second one or more columns.

### Claim 7 (depends on 1)

The system of claim 1, wherein the plurality of database queries are received from a queue, and the one or more processing units are to execute the executable program code to cause the system to:
remove the first set of database queries from the queue to leave a second plurality of database queries in the queue.

### Claim 8 (depends on 7)

The system of claim 7, the one or more processing units to execute the executable program code to cause the system to:
determine a third set of database queries from the second plurality of database queries, where each of the third set of database queries requests data from a same second database table, and where a total count of returned records for the third set of database queries is less than the threshold;
merge the third set of database queries into a second batch query;
transmit the second batch query to the database;
receive a second batch query result set from the database;
for each of the third set of database queries, determine a second result set based on the second batch query result set; and
return the second result sets for each of the third set of database queries.

### Claim 9 (depends on 1)

The system of claim 1, wherein the plurality of database queries comprise a first queue associated with a first database connection, the one or more processing units to execute the executable program code to cause the system to:
determine a second plurality of database queries of a second queue associated with a second database connection;
determine a third set of database queries from the second plurality of database queries, where each of the third set of database queries selects from a second same database table;
determine a second count of returned records for each of the third set of database queries;
determine a fourth set of database queries from the third set of database queries, where a total second count of returned records for the fourth set of database queries is less than the threshold;
determine a second batch query based on the fourth set of database queries;
transmit the second batch query to the database;
receive a second batch query result set from the database;
for each of the fourth set of database queries, determine a second result set based on the second batch query result set; and
return the second result sets for each of the fourth set of database queries.

### Claim 10 (depends on 1)

The system of claim 1, wherein transmission of the batch query to the database comprises:
determination that a database connector to the database is available; and
transmission of the batch query to the database via the database connector only if it is determined that the database connector is available.

### Claim 11 (depends on 1)

The system of claim 1, where the plurality of database queries comprises the first set of database queries and a second set of database queries, the one or more processing units to execute the executable program code to cause the system to:
successively transmit each of the second set of database queries to the database after reception of the batch query result set from the database.

### Claim 12 (depends on 11)

The system of claim 11, wherein the plurality of database queries are received from a queue, and wherein one of the second set of database queries was stored in the queue before one of the first set of database queries was stored in the queue.

### Claim 13 (depends on 1)

The system of claim 1, where determination of the first set of database queries comprises determination that a number of the first set of database queries is less than a maximum number of queries to batch.

### Claim 14

A method comprising:
identifying a plurality of database queries in a queue;
determining a first set of database queries of the plurality of database queries, where each of the first set of database queries requests data from a same database table, and where a total count of returned records for the first set of database queries is less than a threshold;
determining a batch query based on the first set of database queries;
transmitting the batch query to a database;
receiving a batch query result set from the database;
for each of the first set of database queries, determine a result set from the batch query result set; and
return the result sets for each of the first set of database queries.

### Claim 15 (depends on 14)

The method of claim 14, wherein a first one of the first set of database queries requests data from a first one or more columns of the database table and a second one of the first set of database queries requests data from a second one or more columns of the database table, wherein the batch query includes a subclause respectively associated with each of the first set of database queries, wherein a subclause associated with the first one of the first set of database queries defines NULL fields for ones of the second one or more columns which are not in the first one or more columns, and wherein a subclause associated with the second one of the first set of database queries defines NULL fields for ones of the first one or more columns which are not in the second one or more columns.

### Claim 16 (depends on 14)

The method of claim 14, wherein the batch query includes a subclause respectively associated with each of the first set of database queries, and each subclause defines a query identifier column populated with an identifier of its respective database query.

### Claim 17 (depends on 14)

The method of claim 14, further comprising:
removing the first set of database queries from the queue to leave a second plurality of database queries in the queue;
determining a third set of database queries from the second plurality of database queries, where each of the third set of database queries requests data from a same second database table, and where a total count of returned records for the third set of database queries is less than the threshold;
determining a second batch query based on the third set of database queries;
transmitting the second batch query to the database;
receiving a second batch query result set from the database;
for each of the third set of database queries, determining a second result set based on the second batch query result set; and
returning the second result sets for each of the third set of database queries.

### Claim 18 (depends on 14)

The method of claim 14, wherein the plurality of database queries comprises the first set of database queries and a second set of database queries, and wherein one of the second set of database queries was stored in the queue before one of the first set of database queries was stored in the queue, the method further comprising:
successively transmitting each of the second set of database queries to the database after reception of the batch query result set from the database.

### Claim 19

One or more non-transitory computer-readable media storing program code that, when executed by a computing system, causes the computing system to perform operations comprising:
receiving a plurality of database queries;
determining a first set of database queries from the plurality of database queries, where each of the first set of database queries requests data from a same database table, and where a total count of returned records for the first set of database queries is less than a threshold merging the first set of database queries into a batch query;
transmitting the batch query to a database;
receiving a batch query result set from the database;
for each of the first set of database queries, determining a result set from the batch query result set; and
returning the result sets for each of the first set of database queries.

### Claim 20 (depends on 19)

The one or more non-transitory computer-readable media storing program code according to claim 19 that, when executed by the computing system, causes the computing system to perform operations comprising:
removing the first set of database queries from the queue to leave a second plurality of database queries in the queue;
determining third set of database queries from the second plurality of database queries, where each of the third set of database queries requests data from a same second database table;
merging the third set of database queries into a second batch query;
transmitting the second batch query to the database;
receiving a second batch query result set from the database;
for each of the third set of database queries, determining a second result set based on the second batch query result set; and
returning the second result sets for each of the third set of database queries.
