IP Library › Granted Patent US 12,724,772
Granted Patent B2
US 12,724,772 · App. 18/545,889 · Granted Sep 1, 2026

Predictive resource allocation for distributed query execution

Inventors: Qiming Jiang (Redmond, WA); Orestis Kostakis (Redmond, WA)
Assignee: Snowflake Inc.
G06F16/24542G06F16/2455G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,724,772
App. No.
18/545,889
Granted
Sep 1, 2026
Kind
B2
Abstract

The subject technology receives a query directed to a set of source tables, each source table organized into a set of micro-partitions. The subject technology determines a set of metadata, the set of metadata comprising table metadata, query metadata, and historical data related to the query. The subject technology predicts, using a machine learning model, an indicator of an amount of computing resources for executing the query based at least in part on the set of metadata. The subject technology generates a query plan for executing the query based at least in part on the predicted indicator of the amount of computing resources. The subject technology executes the query based at least in part on the query plan.

Claims (56)

1 . A system comprising:

at least one hardware processor; and

at least one memory storing instructions that cause the at least one hardware processor to perform operations comprising:

receiving a query directed to one or more source tables a set of source tables, each source table organized into a set of micro-partitions;

predicting, using a machine learning model, an indicator of an amount of computing resources for executing the query by applying query data associated with one or more characteristics of the received query and source table data associated with one or more characteristics of the one or more source tables as input to the machine learning model, the machine learning model trained to generate a prediction of the amount of computing resources for queries based on inputted query data and source table data, the amount of computing resources indicating a number of query-executing servers predicted to execute the query, the predicting of the amount of computing resources being associated with an allocation of a number of additional query-executing servers for executing the query by:

identifying a parallelization limit characteristic for the received query, the parallelization limit characteristic corresponding to (1) a number of query-executing servers and (2) a ratio between a number of additional query-executing servers and a decrease in execution time of the query responsive to the additional query-executing servers, wherein the additional query-executing servers indicate an amount of increase to the number of query-executing servers;

determining that the predicted amount of computing resources for executing the query is at or above a parallelization threshold for the parallelization limit characteristic; and

executing the query based at least in part on the predicted indicator of the amount of computing resources.

2 . The system of claim 1 , wherein the one or more source tables include a set of source tables, each source table organized into a set of micro-partitions.

3 . The system of claim 1 , the operations further comprising determining a set of metadata, the machine learning model trained to generate a prediction of the amount of computing resources for queries further based on the set of metadata.

4 . The system of claim 3 , wherein the set of metadata comprising table metadata, query metadata, and historical data related to the query.

5 . The system of claim 3 , wherein processing, using the machine learning model, at least the set of metadata comprises:

providing the set of metadata as input data to the machine learning model;

running the machine learning model to generate a value indicating the amount of computing resources for executing the query, the value corresponding to a prediction of the amount of computing resources to utilize for executing the query in an execution platform; and

providing the value indicating the amount of computing resources to a query compiler to utilize when generating a query plan.

6 . The system of claim 1 , the operations further comprising generating a query plan for executing the query based at least in part on the predicted indicator of the amount of computing resources.

7 . The system of claim 1 , wherein the operations further comprise:

analyzing the query against historical data related to the query to determine whether a previous query, being a same query as the query, has been executed at a previous time prior to receiving the query; and

in response to the query not being executed at the previous time, analyzing global history information of previous queries, the global history information comprising query execution times of the previous queries and corresponding computing resources utilized to execute the previous queries.

8 . The system of claim 7 , wherein running the machine learning model further comprises:

receiving input data at an input layer of the machine learning model;

forwarding, from the input layer, at least the received input data to a hidden layer of the machine learning model;

applying, by the hidden layer, an activation function to the received input data to generate first output data, the first output data being received by an output layer of the machine learning model; and

applying, by the output layer, a second activation function to the first output data.

9 . The system of claim 1 , wherein predicting, using the machine learning model, the indicator of the amount of computing resources for executing the query by applying a set of metadata comprising table metadata, query metadata, and historical data related to the query as input to the machine learning model further comprises:

generating a particular prediction that parallelization is not needed for executing the query, the parallelization comprising an allocation of additional virtual warehouses to a number of virtual warehouse predicted to execute the query, the prediction that parallelization is not needed being based on determining that the query executes in a particular period of time that is a same execution time as when one virtual warehouse is being utilized to execute the query.

10 . The system of claim 9 , wherein the operations further comprise:

providing second output data of a second activation function as the prediction of the amount of computing resources to utilize for executing the query in an execution platform.

11 . The system of claim 8 , wherein the operations further comprise:

retrieving global query metadata from a database, the global query metadata comprising information of queries that were previously executed; and

providing the global query metadata as second input data to the machine learning model.

12 . The system of claim 11 , wherein the operations further comprise:

determining that retrieved global query metadata includes a threshold amount of new data since a previous time that the machine learning model was trained using a previous set of global query metadata;

training the machine learning model based at least in part on the retrieved global query metadata; and

deploying the trained machine learning model as a new machine learning model to predict the indicator of the amount of computing resources for executing the query.

13 . The system of claim 1 , wherein predicting the indicator of the amount of computing resources for executing the query is further based on an expert system including a set of rules, the set of rules emulating a decision making of a human, the set of rules utilizing information stored in a knowledge base.

14 . A method comprising:

receiving a query directed to one or more source tables a set of source tables, each source table organized into a set of micro-partitions;

predicting, using a machine learning model, an indicator of an amount of computing resources for executing the query by applying query data associated with one or more characteristics of the received query and source table data associated with one or more characteristics of the one or more source tables as input to the machine learning model, the machine learning model trained to generate a prediction of the amount of computing resources for queries based on inputted query data and source table data, the amount of computing resources indicating a number of query-executing servers predicted to execute the query, the predicting of the amount of computing resources being associated with an allocation of a number of additional query-executing servers for executing the query by:

identifying a parallelization limit characteristic for the received query, the parallelization limit characteristic corresponding to (1) a number of query-executing servers and (2) a ratio between a number of additional query-executing servers and a decrease in execution time of the query responsive to the additional query-executing servers, wherein the additional query-executing servers indicate an amount of increase to the number of query-executing servers;

determining that the predicted amount of computing resources for executing the query is at or above a parallelization threshold for the parallelization limit characteristic; and

executing the query based at least in part on the predicted indicator of the amount of computing resources.

15 . The method of claim 14 , wherein the one or more source tables include a set of source tables, each source table organized into a set of micro-partitions.

16 . The method of claim 14 , the method further comprising determining a set of metadata, the machine learning model trained to generate a prediction of the amount of computing resources for queries further based on the set of metadata.

17 . The method of claim 14 , the method further comprising generating a query plan for executing the query based at least in part on the predicted indicator of the amount of computing resources.

18 . The method of claim 14 , the method further comprising:

analyzing the query against historical data related to the query to determine whether a previous query, being a same query as the query, has been executed at a previous time prior to receiving the query; and

in response to the query not being executed at the previous time, analyzing global history information of previous queries, the global history information comprising query execution times of the previous queries and corresponding computing resources utilized to execute the previous queries.

19 . The method of claim 14 , wherein predicting, using the machine learning model, the indicator of the amount of computing resources for executing the query by applying a set of metadata comprising table metadata, query metadata, and historical data related to the query as input to the machine learning model further comprises:

generating a particular prediction that parallelization is not needed for executing the query, the parallelization comprising an allocation of additional virtual warehouses to a number of virtual warehouse predicted to execute the query, the prediction that parallelization is not needed being based on determining that the query executes in a particular period of time that is a same execution time as when one virtual warehouse is being utilized to execute the query.

20 . A non-transitory computer-storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:

receiving a query directed to one or more source tables a set of source tables, each source table organized into a set of micro-partitions;

predicting, using a machine learning model, an indicator of an amount of computing resources for executing the query by applying query data associated with one or more characteristics of the received query and source table data associated with one or more characteristics of the one or more source tables as input to the machine learning model, the machine learning model trained to generate a prediction of the amount of computing resources for queries based on inputted query data and source table data, the amount of computing resources indicating a number of query-executing servers predicted to execute the query, the predicting of the amount of computing resources being associated with an allocation of a number of additional query-executing servers for executing the query by:

identifying a parallelization limit characteristic for the received query, the parallelization limit characteristic corresponding to (1) a number of query-executing servers and (2) a ratio between a number of additional query-executing servers and a decrease in execution time of the query responsive to the additional query-executing servers, wherein the additional query-executing servers indicate an amount of increase to the number of query-executing servers;

determining that the predicted amount of computing resources for executing the query is at or above a parallelization threshold for the parallelization limit characteristic; and

executing the query based at least in part on the predicted indicator of the amount of computing resources.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 19, 2023
From: JIANG, QIMING; KOSTAKIS, ORESTIS
To: SNOWFLAKE INC.
Reel/Frame 065915/0617 →
Continuity (2)
Continuation 17157233 · Jan 25, 2021
Related Publication 20240119051A1 · Apr 11, 2024
References Cited (32)
US 9256646B2 · Deshmukh et al. · 2016 [cited by applicant]
US 9262479B2 · Deshmukh et al. · 2016 [cited by applicant]
US 10909114B1 · Virtuoso · 2021 [cited by examiner]
US 11100106B1 · Sainanee · 2021 [cited by examiner]
US 11327970B1 · Li · 2022 [cited by examiner]
US 20180060394A1 · Gawande · 2018 [cited by examiner]
US 20200050694A1 · Avalani · 2020 [cited by examiner]
US 20200349161A1 · Siddiqui · 2020 [cited by examiner]
US 20210034598A1 · Arye · 2021 [cited by examiner]
US 20210165783A1 · Deshpande · 2021 [cited by examiner]
US 20210193320A1 · Shukla · 2021 [cited by examiner]
US 20220237192A1 · Jiang et al. · 2022 [cited by applicant]
WO 2022159932 · 2022 [cited by applicant]
U.S. Appl. No. 17/157,233, filed Jan. 25, 2021, Predictive Resource Allocation for Distributed Query Execution. [cited by applicant]
“U.S. Appl. No. 17/157,233, Non Final Office Action mailed Jul. 20, 2021”, 20 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Response filed Oct. 14, 2021 to Non Final Office Action mailed Jul. 20, 2021”, 10 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Final Office Action mailed Dec. 15, 2021”, 20 pgs. [cited by applicant]
“International Application Serial No. PCT US2022 070217, International Search Report mailed Feb. 8, 2022”, 2 pgs. [cited by applicant]
“International Application Serial No. PCT US2022 070217, Written Opinion mailed Feb. 8, 2022”, 3 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Response filed Mar. 15, 2022 to Final Office Action mailed Dec. 15, 2021”, 12 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Non Final Office Action mailed Apr. 13, 2022”, 24 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Response filed Jul. 13, 2022 to Non Final Office Action mailed Apr. 13, 2022”, 11 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Final Office Action mailed Sep. 1, 2022”, 25 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Response filed Nov. 30, 2022 to Final Office Action mailed Sep. 1, 2022”, 12 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Non Final Office Action mailed Dec. 28, 2022”, 26 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Response filed Mar. 31, 2023 to Non Final Office Action mailed Dec. 28, 2022”, 13 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Final Office Action mailed May 23, 2023”, 25 pgs. [cited by applicant]
“International Application Serial No. PCT US2022 070217, International Preliminary Report on Patentability mailed Aug. 3, 2023”, 5 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Response filed Aug. 18, 2023 to Final Office Action mailed May 23, 2023”, 12 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Examiner Interview Summary mailed Aug. 21, 2023”, 2 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Notice of Allowance mailed Oct. 13, 2023”, 7 pgs. [cited by applicant]
“U.S. Appl. No. 17/157,233, Notice of Allowability mailed Nov. 8, 2023”, 1 pg. [cited by applicant]