# US 2018/0322168 A1 · Technologies for asynchronous querying

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

- Number: US 2018/0322168 A1
- Document ID: US20180322168A1
- Status: Published application
- Kind: A1
- Application number: 15/586,714
- Filed: 2017-05-04
- Published: 2018-11-08
- Earliest claimed: 2017-05-04
- Assignees: salesforce.com, inc.
- Applicants: salesforce.com, Inc.
- Inventors: Eli LEVINE; Samarpan Jain; James Ferguson; Jan Asita Fernando; Bharadwaj Tanikella; Saikiran Perumala; Cody Marcel
- Web page: https://patentgrep.com/patent/US20180322168A1

## CPC

- G06F 16/2448: {for particular applications; for extensibility, e.g. user defined types}
- G06F 16/2471: {Distributed queries}
- G06F 16/252: {between a Database Management System and a front-end application}
- G06F 16/256: {in federated or virtual databases}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems, methods, and computer-readable media for asynchronous (async) querying are described. In embodiments, a system may convert a user-issued query into a distributed execution instruction set (DEIS), and issue the DEIS to data stores that may have various database structures. The system may obtain database objects from the data stores, and store a result set indicating the obtained database objects in a location specified by the user-issued query. The system may also provide mechanisms to allow users to view progress of their async query jobs and/or cancel ongoing async query jobs. Other embodiments may be described and/or claimed.

## Claims

### Claim 1

A computer program to be implemented by a database system, the computer program comprising a set of instructions operable to:
obtain a user-issued query;
convert the user-issued query into a distributed execution instruction set (DEIS);
issue the DEIS to a plurality of data stores, the plurality of data stores including at least one data store having a data structure that is different than other data stores of the plurality of data stores;
obtain database objects from the plurality of data stores to which the DEIS was issued; and
store a result set indicating the obtained database objects in a location specified by the user-issued query.

### Claim 2 (depends on 1)

The computer program of claim 1, wherein the set of instructions is operable to:
identify an asynchronous (async) query verb within the user-issued query; and
convert the user-issued query into the DEIS only when the user-issued query include the async query verb.

### Claim 3 (depends on 1)

The computer program of claim 1, wherein the set of instructions is operable to:
generate an async query job (AQJ) entity in response to receipt of the user-issued query;
transition the AQJ entity to a scheduled state prior to conversion of the user-issued query into the DEIS; and
transition the AQJ entity to a running state to convert the user-issued query into the DEIS.

### Claim 4 (depends on 3)

The computer program of claim 3, wherein the AQJ entity comprises a plurality of AQJ fields, and the plurality of AQJ fields include an AQJ identifier (ID) of the AQJ entity and a status field, and wherein the set of instructions is operable to:
alter the status field to indicate that the AQJ entity is in the scheduled state after the AQJ entity is placed in the schedule state; and
alter the status field to indicate that the AQJ entity is in the running state after the AQJ entity is placed in the running state.

### Claim 5 (depends on 4)

The computer program of claim 4, wherein the set of instructions is operable to:
determine whether a maximum number of AQJs in a predetermined time period have been invoked by a user that issued the user-issued query;
determine whether a maximum number of concurrent AQJs invoked by the user are currently running;
transition the AQJ entity into a rejected state when the maximum number of AQJs in the predetermined time period have been invoked by the user or when the maximum number of concurrent AQJs invoked by the user are currently running; and
alter the status field to indicate that the AQJ entity is in the rejected state after the AQJ entity is placed in the rejected state.

### Claim 6 (depends on 4)

The computer program of claim 4, wherein the set of instructions is operable to:
determine whether the user-issued query or the DEIS includes any syntax errors;
transition the AQJ entity into a failed state when the user-issued query or the DEIS includes any syntax errors; and
alter the status field to indicate that the AQJ entity is in the failed state after the AQJ entity is placed in the failed state.

### Claim 7 (depends on 4)

The computer program of claim 4, wherein the set of instructions is operable to:
determine whether store the result set was improperly stored in the location specified by the user-issued query;
transition the AQJ entity into a failed state when the result set was improperly stored in the location specified by the user-issued query; and
alter the status field to indicate that the AQJ entity is in the failed state after the AQJ entity is placed in the failed state.

### Claim 8 (depends on 4)

The computer program of claim 4, wherein the set of instructions is operable to:
obtain, from a user system, a request for a status of the AQJ entity, the request including the AQJ ID of the AQJ entity;
identify a value of the status field of the AQJ entity based on the AQJ ID in the request;
generate a response including the value of the status field; and
send the response to the user system.

### Claim 9 (depends on 1)

The computer program of claim 1, wherein the DEIS comprises a set of MapReduce (MR) jobs, and wherein, to issue the DEIS to a plurality of data stores, the set of instructions is operable to:
issue individual MR jobs of the set of MR jobs to corresponding data stores of the plurality of data stores.

### Claim 10

A database system comprising:
a network interface to obtain a first message from a user system, wherein the first message includes a user-issued query invoking asynchronous (async) querying;
a processor system coupled with the network interface, the processor system to:
generate an async query job (AQJ) entity in response to the invocation of the async querying, the AQJ entity comprising a plurality of fields,
insert an AQJ identifier (ID) of the AQJ entity into a AQJ queue and into an AQJ ID field of the plurality of fields,
operate a query engine to convert the user-issued query into a distributed execution instruction set (DEIS), and
alter a status field of the plurality of fields based on a status of the AQJ entity; and
the network interface is to:
send a second message to cause the DEIS to be issued to a plurality of data stores, and
obtain a third message indicating a status of a result set, the result set indicating obtained database objects in a location specified by the user-issued query, and
store the status of the storing in the status field.

### Claim 11 (depends on 10)

The database system of claim 10, wherein the processor system is to:
identify an async query verb within the user-issued query that invokes the async querying; and
convert the user-issued query into the DEIS only when the user-issued query include the async query verb.

### Claim 12 (depends on 10)

The database system of claim 10, wherein the processor system is to:
transition the AQJ entity to a scheduled state in response to receipt of the user-issued query;
insert a first value into the status field to indicate that the AQJ entity is in the scheduled state after the AQJ entity is placed in the schedule state;
transition the AQJ entity to a running state to convert the user-issued query into the DEIS;
insert a second value into the status field to indicate that the AQJ entity is in the scheduled state after the AQJ entity is placed in the schedule state.

### Claim 13 (depends on 10)

The database system of claim 10, wherein the processor system is to:
identify job level errors during conversion of the user-issued query into the DEIS;
identify job level errors or record level errors from the third message; and
insert a third value into the status field to indicate that the AQJ entity is in a failed state when job level errors occur during the conversion or when the third message indicates job level errors or record level errors.

### Claim 14 (depends on 10)

The database system of claim 10, wherein the processor system is to:
input, into a hash function, the identified job level errors that occurred to the conversion, the job level errors from the third message, and the record level errors from the third message;
identify a sample of errors based on an output of the hash function; and
generate the third value to include the sample of similar errors.

### Claim 14 (depends on 10)

The database system of claim 10, wherein the processor system is to:
determine whether a governor limit has been met based on invocation of the async querying; and
insert a fourth value into the status field to indicate that the AQJ entity is in a rejected state when the governor limit has been met.

### Claim 15 (depends on 10)

The database system of claim 10, wherein:
the processor system is to generate a fourth message including a value of the status field, and
the network interface is to send the fourth message to the user system.

### Claim 16 (depends on 15)

The database system of claim 15, wherein:
the network interface is to obtain a fifth message from the user system, the fifth message indicating the AQJ ID and a request for a status of the AQJ entity, and
the processor system is to generate the fourth message in response to receipt of the fifth message.

### Claim 17 (depends on 15)

The database system of claim 15, wherein:
the network interface is to obtain a sixth message from the user system, the sixth message indicating the AQJ ID and a request to terminate the AQJ entity, and
the processor system is to:
terminate the AQJ entity,
insert a fifth value into the status field to indicate that the AQJ entity has been terminated, and
generate the fourth message in response to receipt of the sixth message.

### Claim 19

A computer program to be implemented by a cloud computing service, the computer program comprising a set of instructions operable to:
obtain a distributed execution instruction set (DEIS) from a database system, the DEIS comprising a set of MapReduce (MR) jobs, and the DEIS being based on a user-issued query in a query language that is different from a language of the DEIS;
identify data stores corresponding to individual MR jobs of the set of MR jobs; and
execute the individual MR jobs to obtain database objects from the corresponding data stores.

### Claim 20 (depends on 19)

The computer program of claim 19, wherein the set of instructions is operable to:
load the database objects from the corresponding data stores;
perform data processing operations according to the DEIS, the data processing operations including filtering, aggregation, and join operations; and
store results of the data manipulation operations into a database object indicated by the DEIS.
