IP Library Granted Patent US 11,907,221
Granted Patent B2
US 11,907,221 · App. 17/804,770 · Granted Feb 20, 2024

Scheduling parallel execution of query sub-plans

Inventors: Sebastian Breß (Berlin, DE); Moritz Eyssen (Berlin, DE); Max Heimel (Berlin, DE)
Assignee: Snowflake Inc.
G06F16/24545G06F16/24532G06F16/24537
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 11,907,221
App. No.
17/804,770
Granted
Feb 20, 2024
Kind
B2
Abstract

Sub-plans are executed in parallel using a plurality of execution nodes, which can be part of a data platform. In particular, various embodiments identify sub-plans (e.g., fragments or portions of one or more child operators) of a root operator in a query plan such that the identified sub-plans that are candidates for execution on a single execution node, determine a cost estimate for causing the candidate sub-plans to be executed in parallel using multiple execution nodes, and cause the candidate sub-plans to be executed in parallel based on the cost estimate.

Claims (69)

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:

accessing a query plan that comprises at least one root operator, the at least one root operator being associated with a plurality of sub-plans;

identifying, from the plurality of sub-plans, a sub-plurality of sub-plans that each involves processing a data set that satisfies a set of criteria;

estimating a first cost for executing individual sub-plans of the sub-plurality of sub-plans successively using a plurality of execution nodes;

estimating a second cost for executing the sub-plurality of sub-plans in parallel using the plurality of execution nodes;

comparing the first cost to the second cost;

determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes; and

in response to determining that the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes, causing the sub-plurality of sub-plans to be executed in parallel using the plurality of execution nodes by performing, for each single sub-plan in the sub-plurality of sub-plans, a single scheduling operation to assign execution of an entire portion of the single sub-plan to a single execution node of the plurality of execution nodes, the single execution node being configured to generate a local schedule queue to process the single sub-plan assigned to the single execution node.

2. The system of claim 1 , wherein the determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes comprises:

based on the comparing, determining whether the first cost is greater than the second cost; and

in response to determining that the first cost is greater than the second cost, determining to execute the sub-plurality of sub-plans in parallel using the plurality of execution nodes.

3. The system of claim 1 , wherein the determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes comprises:

based on the comparing, determining whether the first cost is at least greater than the second cost by a threshold value; and

in response to determining that the first cost is at least greater than the second cost by the threshold value, determining to execute the sub-plurality of sub-plans in parallel using the plurality of execution nodes.

4. The system of claim 3 , wherein the threshold value comprises a ratio of the first cost and the second cost.

5. The system of claim 1 , wherein the data set comprises one or more files.

6. The system of claim 1 , wherein the at least one root operator comprising a join operator.

7. The system of claim 1 , wherein the at least one root operator comprising a union all operator.

8. The system of claim 1 , wherein sub-plans in the sub-plurality of sub-plans have a same set of dependencies.

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

maintaining a dependency map that describes one or more dependencies between individual operators to be executed, the dependency map being initialized based on the query plan, and the identifying the sub-plurality of sub-plans being based on the dependency map.

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

selecting the at least one root operator from a global scheduling queue.

11. The system of claim 1 , wherein the set of criteria includes one or more criteria for identifying the data set that is capable of being executed by a single execution node.

12. A method comprising:

accessing a query plan that comprises at least one root operator, the at least one root operator being associated with a plurality of sub-plans;

identifying, from the plurality of sub-plans, a sub-plurality of sub-plans that each involves processing a data set that satisfies a set of criteria;

estimating a first cost for executing individual sub-plans of the sub-plurality of sub-plans successively using a plurality of execution nodes;

estimating a second cost for executing the sub-plurality of sub-plans in parallel using the plurality of execution nodes;

comparing the first cost to the second cost;

determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes; and

in response to determining that the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes, causing the sub-plurality of sub-plans to be executed in parallel using the plurality of execution nodes by performing, for each single sub-plan in the sub-plurality of sub-plans, a single scheduling operation to assign execution of an entire portion of the single sub-plan to a single execution node of the plurality of execution nodes, the single execution node being configured to generate a local schedule queue to process the single sub-plan assigned to the single execution node.

13. The method of claim 12 , wherein the determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes comprises:

based on the comparing, determining whether the first cost is greater than the second cost; and

in response to determining that the first cost is greater than the second cost, determining to execute the sub-plurality of sub-plans in parallel using the plurality of execution nodes.

14. The method of claim 12 , wherein the determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes comprises:

based on the comparing, determining whether the first cost is at least greater than the second cost by a threshold value; and

in response to determining that the first cost is at least greater than the second cost by the threshold value, determining to execute the sub-plurality of sub-plans in parallel using the plurality of execution nodes.

15. The method of claim 14 , wherein the threshold value comprises a ratio of the first cost and the second cost.

16. The method of claim 12 , wherein the data set comprises one or more files.

17. The method of claim 12 , wherein the at least one root operator comprising a join operator.

18. The method of claim 12 , wherein the at least one root operator comprising a union all operator.

19. The method of claim 12 , wherein sub-plans in the sub-plurality of sub-plans have a same set of dependencies.

20. The method of claim 19 , comprising:

maintaining a dependency map that describes one or more dependencies between individual operators to be executed, the dependency map being initialized based on the query plan, and the identifying the sub-plurality of sub-plans being based on the dependency map.

21. The method of claim 12 , comprising:

selecting the at least one root operator from a global scheduling queue.

22. The method of claim 12 , wherein the set of criteria includes one or more criteria for identifying the data set that is capable of being executed by a single execution node.

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

accessing a query plan that comprises at least one root operator, the at least one root operator being associated with a plurality of sub-plans;

identifying, from the plurality of sub-plans, a sub-plurality of sub-plans that each involves processing a data set that satisfies a set of criteria;

estimating a first cost for executing individual sub-plans of the sub-plurality of sub-plans successively using a plurality of execution nodes;

estimating a second cost for executing the sub-plurality of sub-plans in parallel using the plurality of execution nodes;

comparing the first cost to the second cost;

determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes; and

in response to determining that the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes, causing the sub-plurality of sub-plans to be executed in parallel using the plurality of execution nodes by performing, for each single sub-plan in the sub-plurality of sub-plans, a single scheduling operation to assign execution of an entire portion of the single sub-plan to a single execution node of the plurality of execution nodes, the single execution node being configured to generate a local schedule queue to process the single sub-plan assigned to the single execution node.

24. The non-transitory computer-readable medium of claim 23 , wherein the determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes comprises:

based on the comparing, determining whether the first cost is greater than the second cost; and

in response to determining that the first cost is greater than the second cost, determining to execute the sub-plurality of sub-plans in parallel using the plurality of execution nodes.

25. The non-transitory computer-readable medium of claim 23 , wherein the determining, based on the comparing, whether the sub-plurality of sub-plans is to be executed in parallel using the plurality of execution nodes comprises:

based on the comparing, determining whether the first cost is at least greater than the second cost by a threshold value; and

in response to determining that the first cost is at least greater than the second cost by the threshold value, determining to execute the sub-plurality of sub-plans in parallel using the plurality of execution nodes.

26. The non-transitory computer-readable medium of claim 25 , wherein the threshold value comprises a ratio of the first cost and the second cost.

27. The non-transitory computer-readable medium of claim 23 , wherein the data set comprises one or more files.

28. The non-transitory computer-readable medium of claim 23 , wherein the at least one root operator comprising a join operator.

29. The non-transitory computer-readable medium of claim 23 , wherein the at least one root operator comprising a union all operator.

30. The non-transitory computer-readable medium of claim 23 , wherein sub-plans in the sub-plurality of sub-plans have a same set of dependencies.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 31, 2022
From: BRESS, SEBASTIAN; EYSSEN, MORITZ; HEIMEL, MAX
To: SNOWFLAKE INC.
Reel/Frame 060059/0871 →
Continuity (3)
Continuation 17647629 · Jan 11, 2022
Provisional Application 63265606 · Dec 17, 2021
Related Publication 20230195729A1 · Jun 22, 2023