IP Library Granted Patent US 12,730,810
Granted Patent B2
US 12,730,810 · App. 18/987,419 · Granted Sep 8, 2026

Interleaved execution infrastructure in database engines

Inventors: Thierry Cruanes (San Mateo, CA); Benoit Dageville (San Mateo, CA); Igor Demura (Mountain View, CA); Brian Charles Forney (Mountain View, CA); Weili Gu (Sunnyvale, CA); Yujie Li (Santa Clara, CA); Mohammad Saber Mirzaei (Seattle, WA); Jaeyun Noh (Sunnyvale, CA); Jiaqi Yan (Menlo Park, CA)
Assignee: Snowflake Inc.
G06F16/24542G06F16/24532G06F16/2454
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,730,810
App. No.
18/987,419
Granted
Sep 8, 2026
Kind
B2
Abstract

Interleaved infrastructure can interleave fragment execution during query compilation. For example, compilation can be paused, and a plan fragment is executed. The results of the plan fragment can be fed back into the compiler, which can then restart the compilation and modify the compilation based on the results of the plan fragment execution. The interleaved workflow provides a flexible, robust infrastructure, which can enable and improve a variety of database features and query optimizations.

Claims (58)

1 . A system comprising:

at least one hardware processor; and

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

receiving, by a network-based data system, a query;

generating, by at least one server in the network-based data system, a query plan to execute the query;

detecting a plan fragment of the query plan for early execution, the plan fragment comprising a dynamic resolving object, the dynamic resolving object comprising a macro expression;

pausing compilation of the query plan based on detecting the plan fragment;

assigning, by the at least one server, the plan fragment to one or more execution platforms in the network-based data system for execution;

executing, by one or more execution platforms in the network-based data system, the plan fragment while the compilation of the query plan is paused, the executing comprising:

expanding a definition of a user defined function (UDF) in the plan fragment;

executing the macro expression based on the expanded definition; and

generating results based on executing the macro expression, the results comprising at least one generated definition of the UDF;

receiving, by the at least one server, results of executing the plan fragment from the one or more execution platforms;

modifying, by the at least one server, the compilation of the query plan based on the results; and

completing compilation of the query plan.

2 . The system of claim 1 , wherein the plan fragment further comprises a dynamic evaluation expression.

3 . The system of claim 2 , wherein the dynamic evaluation expression comprises a constant subquery.

4 . The system of claim 1 , the operations further comprising:

collecting query plan properties of the query plan, comprising a list of classes referenced in the query plan;

wherein detecting the plan fragment is based on the query plan properties.

5 . The system of claim 1 , wherein executing the plan fragment comprises executing a recursive query based on the plan fragment.

6 . A method comprising:

receiving, by a network-based data system, a query;

generating, by at least one server in the network-based data system, a query plan to execute the query;

detecting a plan fragment of the query plan for early execution, the plan fragment comprising a dynamic resolving object, the dynamic resolving object comprising a macro expression;

pausing compilation of the query plan based on detecting the plan fragment;

assigning, by the at least one server, the plan fragment to one or more execution platforms in the network-based data system for execution;

executing, by one or more execution platforms in the network-based data system, the plan fragment while the compilation of the query plan is paused, the executing comprising:

expanding a definition of a user defined function (UDF) in the plan fragment;

executing the macro expression based on the expanded definition; and

generating results based on executing the macro expression, the results comprising at least one generated definition of the UDF;

receiving, by the at least one server, results of executing the plan fragment from the one or more execution platforms;

modifying, by the at least one server, the compilation of the query plan based on the results; and

completing compilation of the query plan.

7 . The method of claim 6 , wherein the plan fragment further comprises a dynamic evaluation expression.

8 . The method of claim 7 , wherein the dynamic evaluation expression comprises a constant subquery.

9 . The method of claim 6 , further comprising:

collecting query plan properties of the query plan, comprising a list of classes referenced in the query plan;

wherein detecting the plan fragment is based on the query plan properties.

10 . The method of claim 6 , wherein executing the plan fragment comprises executing a recursive query based on the plan fragment.

11 . A machine-storage medium embodying instructions that, when executed by a machine, cause the machine to perform operations comprising:

receiving, by a network-based data system, a query;

generating, by at least one server in the network-based data system, a query plan to execute the query;

detecting a plan fragment of the query plan for early execution, the plan fragment comprising a dynamic resolving object, the dynamic resolving object comprising a macro expression;

pausing compilation of the query plan based on detecting the plan fragment;

assigning, by the at least one server, the plan fragment to one or more execution platforms in the network-based data system for execution;

executing, by one or more execution platforms in the network-based data system, the plan fragment while the compilation of the query plan is paused, the executing comprising:

expanding a definition of a user defined function (UDF) in the plan fragment;

executing the macro expression based on the expanded definition; and

generating results based on executing the macro expression, the results comprising at least one generated definition of the UDF;

receiving, by the at least one server, results of executing the plan fragment from the one or more execution platforms;

modifying, by the at least one server, the compilation of the query plan based on the results; and

completing compilation of the query plan.

12 . The machine-storage medium of claim 11 , wherein the plan fragment further comprises a dynamic evaluation expression.

13 . The machine-storage medium of claim 12 , wherein the dynamic evaluation expression comprises a constant subquery.

14 . The machine-storage medium of claim 11 , the operations further comprising:

collecting query plan properties of the query plan, comprising a list of classes referenced in the query plan;

wherein detecting the plan fragment is based on the query plan properties.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 19, 2024
From: CRUANES, THIERRY; DAGEVILLE, BENOIT; DEMURA, IGOR; FORNEY, BRIAN CHARLES; GU, WEILI; LI, YUJIE; MIRZAEI, MOHAMMAD SABER; NOH, JAEYUN; YAN, JIAQI
To: SNOWFLAKE INC.
Reel/Frame 069637/0937 →
Continuity (2)
Continuation 18162486 · Jan 31, 2023
Related Publication 20250117387A1 · Apr 10, 2025
References Cited (29)
US 9836504B2 · Graefe et al. · 2017 [cited by applicant]
US 10936589B1 · Beitchman et al. · 2021 [cited by applicant]
US 11194815B1 · Kumar et al. · 2021 [cited by applicant]
US 11829363B2 · Freedman et al. · 2023 [cited by applicant]
US 20110228668A1 · Pillai et al. · 2011 [cited by applicant]
US 20180121505A1 · Barsness · 2018 [cited by examiner]
US 20180165610A1 · Dumant et al. · 2018 [cited by applicant]
US 20190236202A1 · Guney · 2019 [cited by examiner]
US 20200110827A1 · Freedman · 2020 [cited by examiner]
US 20200278960A1 · Rintanen · 2020 [cited by applicant]
US 20200334231A1 · Muralidhar et al. · 2020 [cited by applicant]
US 20200334241A1 · Muralidhar et al. · 2020 [cited by applicant]
US 20210263929A1 · Chen · 2021 [cited by examiner]
US 20210365456A1 · Kondiles · 2021 [cited by examiner]
US 20210374135A1 · Cruanes · 2021 [cited by examiner]
US 20210374136A1 · Cruanes · 2021 [cited by examiner]
US 20220114155A1 · Dhuse et al. · 2022 [cited by applicant]
US 20220138168A1 · Veselova et al. · 2022 [cited by applicant]
US 20230385277A1 · Schmidt et al. · 2023 [cited by applicant]
US 20240256540A1 · Cruanes et al. · 2024 [cited by applicant]
“U.S. Appl. No. 18/162,486, Final Office Action mailed Jun. 10, 2024”, 17 pgs. [cited by applicant]
“U.S. Appl. No. 18/162,486, Final Office Action mailed Aug. 22, 2023”, 18 pgs. [cited by applicant]
“U.S. Appl. No. 18/162,486, Non Final Office Action mailed Apr. 11, 2023”, 17 pgs. [cited by applicant]
“U.S. Appl. No. 18/162,486, Non Final Office Action mailed Dec. 7, 2023”, 23 pgs. [cited by applicant]
“U.S. Appl. No. 18/162,486, Notice of Allowance mailed Sep. 24, 2024”, 9 pgs. [cited by applicant]
“U.S. Appl. No. 18/162,486, Response filed Mar. 7, 2024 to Non Final Office Action mailed Dec. 7, 2023”, 15 pgs. [cited by applicant]
“U.S. Appl. No. 18/162,486, Response filed Jul. 11, 2023 to Non Final Office Action mailed Apr. 11, 2023”, 13 pgs. [cited by applicant]
“U.S. Appl. No. 18/162,486, Response filed Sep. 10, 2024 to Final Office Action mailed Jun. 10, 2024”, 11 pgs. [cited by applicant]
“U.S. Appl. No. 18/162,486, Response filed Nov. 21, 2023 to Final Office Action mailed Aug. 22, 2023”, 15 pgs. [cited by applicant]