# US 2021/0342360 A1 · Virtual warehouse pools for executing tasks

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

- Number: US 2021/0342360 A1
- Document ID: US20210342360A1
- Status: Published application
- Kind: A1
- Application number: 17/345,484
- Filed: 2021-06-11
- Published: 2021-11-04
- Earliest claimed: 2020-01-31
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Istvan Cseri; Qiming Jiang
- Web page: https://patentgrep.com/patent/US20210342360A1

## CPC

- G06F 9/5044: {considering hardware capabilities}
- G06F 16/254: {Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses}
- G06F 9/466: {Transaction processing}
- G06F 16/256: {in federated or virtual databases}
- G06N 3/0499: Feedforward networks
- G06N 3/09: Supervised learning
- G06N 20/00: Machine learning
- G06N 3/04: Architecture, e.g. interconnection topology
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The subject technology determines a number of execution nodes to execute a task. The subject technology determines that no virtual warehouse from a pool of virtual warehouses includes at least the number of execution nodes. The subject technology generates a new virtual warehouse including at least the number of execution nodes. The subject technology determines whether a previous execution of a prior task was completed in less than a threshold time period of a time interval, the time interval corresponding to a particular period of time for executing at least one task. The subject technology increments a score corresponding to a size of a particular virtual warehouse. The subject technology selects the new virtual warehouse from the pool of virtual warehouses based at least in part on the incremented score and the number of execution nodes included in the selected new virtual warehouse.

## Claims

### Claim 1

A system comprising:
at least one hardware processor; and
a memory storing instructions that cause the at least one hardware processor to perform operations comprising:
determining a number of execution nodes to execute a task;
determining that no virtual warehouse from a pool of virtual warehouses includes at least the number of execution nodes;
generating a new virtual warehouse including at least the number of execution nodes, the new virtual warehouse being different than each virtual warehouse from the pool of virtual warehouses; and
selecting the new virtual warehouse to execute the task, the selecting comprising:
determining whether a previous execution of a prior task was completed in less than a threshold time period of a time interval, the time interval corresponding to a particular period of time for executing at least one task,
incrementing a score corresponding to a size of a particular virtual warehouse, and
selecting the new virtual warehouse from the pool of virtual warehouses based at least in part on the incremented score and the number of execution nodes included in the selected new virtual warehouse.

### Claim 2 (depends on 1)

The system of claim 1, wherein determining the number of execution nodes to execute the task is based at least in part on a history of sizes of virtual warehouses that previously executed a number of tasks, each size from the sizes of virtual warehouses corresponding to a number of execution nodes provided in an execution platform, and further comprising:
receiving an indication that execution of the task is complete; and
providing an indication that the virtual warehouse is idle.

### Claim 3 (depends on 1)

The system of claim 1, wherein selecting the new virtual warehouse is based on whether the virtual warehouse is currently suspended or idle.

### Claim 4 (depends on 3)

The system of claim 3, wherein the operations further comprise:
sending the task to the new virtual warehouse for execution;
prior to the task being completed, determining a second task in a queue based at least in part on a time interval, the time interval corresponding to a subsequent time window for executing a set of tasks;
determining that the second task can also be executed by a second virtual warehouse that is currently idle;
determining that the second task is unable to be executed by a third virtual warehouse that is currently idle; and
suspending the third virtual warehouse.

### Claim 5 (depends on 1)

The system of claim 1, wherein selecting the new virtual warehouse comprises:
determining that a particular pool of virtual warehouses is not available to assign to execute the task based at least in part on a particular number of execution nodes that are expected to execute the task; and
generating a new pool of virtual warehouses, the new pool of virtual warehouses including a particular virtual warehouse, the particular virtual warehouse including a predetermined number of execution nodes; and
selecting the particular virtual warehouse from the new pool of virtual warehouses to execute the task.

### Claim 6 (depends on 1)

The system of claim 1, wherein each virtual warehouse from the pool of virtual warehouses includes a different number of execution nodes.

### Claim 7 (depends on 1)

The system of claim 1, wherein the new virtual warehouse includes a first number of execution nodes that is smaller than a second number of execution nodes included in a second virtual warehouse associated with the previous execution of the prior task.

### Claim 8 (depends on 1)

The system of claim 1, wherein the new virtual warehouse has a score greater than scores of other virtual warehouses from the pool of virtual warehouses.

### Claim 9 (depends on 1)

The system of claim 1, wherein selecting the new virtual warehouse comprises:
determining that a previous execution of a prior task was completed in greater than a threshold time period of the time interval; and
incrementing a second score corresponding to a second size of the particular virtual warehouse, wherein the particular virtual warehouse includes a first number of execution nodes that is greater than a second number of execution nodes included in a second virtual warehouse associated with the previous execution of the prior task.

### Claim 10 (depends on 1)

The system of claim 1, wherein incrementing the score corresponding to the size of a particular virtual warehouse comprises further operations comprising:
determining a percentage of the particular period of time that a particular task is executed to completion by a corresponding virtual warehouse; and
in response to the percentage of the particular period of time being less than a threshold percentage, incrementing the score, the score indicating a value for reducing a size of a virtual warehouse that will execute a future task, the size of the virtual warehouse corresponding to a particular number of execution nodes used to select a particular virtual warehouse.

### Claim 11

A method comprising:
determining a number of execution nodes to execute a task;
determining that no virtual warehouse from a pool of virtual warehouses includes at least the number of execution nodes;
generating a new virtual warehouse including at least the number of execution nodes, the new virtual warehouse being different than each virtual warehouse from the pool of virtual warehouses; and
selecting the new virtual warehouse to execute the task, the selecting comprising:
determining whether a previous execution of a prior task was completed in less than a threshold time period of a time interval, the time interval corresponding to a particular period of time for executing at least one task,
incrementing a score corresponding to a size of a particular virtual warehouse, and
selecting the new virtual warehouse from the pool of virtual warehouses based at least in part on the incremented score and the number of execution nodes included in the selected new virtual warehouse.

### Claim 12 (depends on 11)

The method of claim 11, wherein determining the number of execution nodes to execute the task is based at least in part on a history of sizes of virtual warehouses that previously executed a number of tasks, each size from the sizes of virtual warehouses corresponding to a number of execution nodes provided in an execution platform, and further comprising:
receiving an indication that execution of the task is complete; and
providing an indication that the virtual warehouse is idle.

### Claim 13 (depends on 11)

The method of claim 11, wherein selecting the new virtual warehouse is based on whether the virtual warehouse is currently suspended or idle.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
sending the task to the new virtual warehouse for execution;
prior to the task being completed, determining a second task in a queue based at least in part on a time interval, the time interval corresponding to a subsequent time window for executing a set of tasks;
determining that the second task can also be executed by a second virtual warehouse that is currently idle;
determining that the second task is unable to be executed by a third virtual warehouse that is currently idle; and
suspending the third virtual warehouse.

### Claim 15 (depends on 11)

The method of claim 11, wherein selecting the new virtual warehouse comprises:
determining that a particular pool of virtual warehouses is not available to assign to execute the task based at least in part on a particular number of execution nodes that are expected to execute the task; and
generating a new pool of virtual warehouses, the new pool of virtual warehouses including a particular virtual warehouse, the particular virtual warehouse including a predetermined number of execution nodes; and
selecting the particular virtual warehouse from the new pool of virtual warehouses to execute the task.

### Claim 16 (depends on 11)

The method of claim 11, wherein each virtual warehouse from the pool of virtual warehouses includes a different number of execution nodes.

### Claim 17 (depends on 11)

The method of claim 11, wherein the new virtual warehouse includes a first number of execution nodes that is smaller than a second number of execution nodes included in a second virtual warehouse associated with the previous execution of the prior task.

### Claim 18 (depends on 11)

The method of claim 11, wherein the new virtual warehouse has a score greater than scores of other virtual warehouses from the pool of virtual warehouses.

### Claim 19 (depends on 11)

The method of claim 11, wherein selecting the new virtual warehouse comprises:
determining that a previous execution of a prior task was completed in greater than a threshold time period of the time interval; and
incrementing a second score corresponding to a second size of the particular virtual warehouse, wherein the particular virtual warehouse includes a first number of execution nodes that is greater than a second number of execution nodes included in a second virtual warehouse associated with the previous execution of the prior task.

### Claim 20 (depends on 11)

The method of claim 11, wherein incrementing the score corresponding to the size of a particular virtual warehouse comprises further operations comprising:
determining a percentage of the particular period of time that a particular task is executed to completion by a corresponding virtual warehouse; and
in response to the percentage of the particular period of time being less than a threshold percentage, incrementing the score, the score indicating a value for reducing a size of a virtual warehouse that will execute a future task, the size of the virtual warehouse corresponding to a particular number of execution nodes used to select a particular virtual warehouse.

### Claim 21

A non-transitory computer-storage medium comprising instructions that, when executed by a processor, configure the processor to perform operations comprising:
determining a number of execution nodes to execute a task;
determining that no virtual warehouse from a pool of virtual warehouses includes at least the number of execution nodes;
generating a new virtual warehouse including at least the number of execution nodes, the new virtual warehouse being different than each virtual warehouse from the pool of virtual warehouses; and
selecting the new virtual warehouse to execute the task, the selecting comprising:
determining whether a previous execution of a prior task was completed in less than a threshold time period of a time interval, the time interval corresponding to a particular period of time for executing at least one task,
incrementing a score corresponding to a size of a particular virtual warehouse, and
selecting the new virtual warehouse from the pool of virtual warehouses based at least in part on the incremented score and the number of execution nodes included in the selected new virtual warehouse.

### Claim 22 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein determining the number of execution nodes to execute the task is based at least in part on a history of sizes of virtual warehouses that previously executed a number of tasks, each size from the sizes of virtual warehouses corresponding to a number of execution nodes provided in an execution platform, and further comprising:
receiving an indication that execution of the task is complete; and
providing an indication that the virtual warehouse is idle.

### Claim 23 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein selecting the new virtual warehouse is based on whether the virtual warehouse is currently suspended or idle.

### Claim 24 (depends on 23)

The non-transitory computer-storage medium of claim 23, wherein the operations further comprise:
sending the task to the new virtual warehouse for execution;
prior to the task being completed, determining a second task in a queue based at least in part on a time interval, the time interval corresponding to a subsequent time window for executing a set of tasks;
determining that the second task can also be executed by a second virtual warehouse that is currently idle;
determining that the second task is unable to be executed by a third virtual warehouse that is currently idle; and
suspending the third virtual warehouse.

### Claim 25 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein selecting the new virtual warehouse comprises:
determining that a particular pool of virtual warehouses is not available to assign to execute the task based at least in part on a particular number of execution nodes that are expected to execute the task; and
generating a new pool of virtual warehouses, the new pool of virtual warehouses including a particular virtual warehouse, the particular virtual warehouse including a predetermined number of execution nodes; and
selecting the particular virtual warehouse from the new pool of virtual warehouses to execute the task.

### Claim 26 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein each virtual warehouse from the pool of virtual warehouses includes a different number of execution nodes.

### Claim 27 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein the new virtual warehouse includes a first number of execution nodes that is smaller than a second number of execution nodes included in a second virtual warehouse associated with the previous execution of the prior task.

### Claim 28 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein the new virtual warehouse has a score greater than scores of other virtual warehouses from the pool of virtual warehouses.

### Claim 29 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein selecting the new virtual warehouse comprises:
determining that a previous execution of a prior task was completed in greater than a threshold time period of the time interval; and
incrementing a second score corresponding to a second size of the particular virtual warehouse, wherein the particular virtual warehouse includes a first number of execution nodes that is greater than a second number of execution nodes included in a second virtual warehouse associated with the previous execution of the prior task.

### Claim 30 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein incrementing the score corresponding to the size of a particular virtual warehouse comprises further operations comprising:
determining a percentage of the particular period of time that a particular task is executed to completion by a corresponding virtual warehouse; and
in response to the percentage of the particular period of time being less than a threshold percentage, incrementing the score, the score indicating a value for reducing a size of a virtual warehouse that will execute a future task, the size of the virtual warehouse corresponding to a particular number of execution nodes used to select a particular virtual warehouse.
