IP Library Granted Patent US 12,204,539
Granted Patent B2
US 12,204,539 · App. 18/298,232 · Granted Jan 21, 2025

Automatic selection of precompiled or code-generated operator variants

Inventor: Till Merker (Sandhausen, DE)
Assignee: SAP SE
G06F16/24542G06F16/2255G06F16/2453G06F16/24544G06F16/2462G06F16/283G06F16/9038
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,204,539
App. No.
18/298,232
Granted
Jan 21, 2025
Kind
B2
Abstract

A system for generating a mixed query plan including operator alternatives. A method may include generating a mixed query plan including a first operator selected as a pre-compiled operator; generating the mixed query plan including a second operator selected as operator alternatives, the operator alternatives configuring the second operator as pre-compiled or code-generating alternatives; delaying selection of one of the operator alternatives until additional information regarding the mixed query plan becomes available; generating the mixed query plan including a third operator selected as a code-generating operator; and selecting, given the third operator representing the additional information, one of the operator alternatives to enable execution of the mixed query plan using the selected operator alternative. Related methods and articles of manufacture are also described.

Claims (28)

1. A system comprising:

at least one data processor; and

at least one memory storing instructions which, when executed by the at least one data processor, result in operations comprising:

generating a mixed query plan including a first operator selected as either a first pre-compiled operator or a first code-generating operator and a second operator configured as operator alternatives, wherein the operator alternatives comprise a second pre-compiled operator and a second code-generating operator, and wherein the operator alternatives are configured to allow a later selection between the second pre-compiled operator and the second code-generating operator after additional information is available regarding whether a subsequent third operator is selected as either a third code-generating operator or a third pre-compiled operator;

continuing to generate the mixed query plan including the selection of the third operator;

selecting the second pre-compiled operator to replace the operator alternatives in response to the third operator being selected as a third pre-compiled operator;

selecting the second code-generating operator to replace the operator alternatives in response to the third operator being selected as a third code-generating operator; and

executing, by an execution engine, the mixed query plan using the selected one of the operator alternatives.

2. The system of claim 1 , wherein the second code-generating operator is associated with code which, when executed at runtime, generates additional code for compilation and execution as part of the mixed query plan.

3. The system of claim 1 , wherein when the selected one of the operator alternatives corresponds to the code-generated operator, the query plan optimizer inserts glue code into the mixed query plan, wherein the glue code decomposes one or more data chunks into a plurality of constituent rows of data.

4. The system of claim 1 , wherein the second pre-compiled operator operates on a different unit of data from the second code-generating operator.

5. A method comprising:

generating a mixed query plan including a first operator selected as either a first pre-compiled operator or a first code-generating operator and a second operator configured as operator alternatives, wherein the operator alternatives comprise a second pre-compiled operator and a second code-generating operator, and wherein the operator alternatives are configured to allow a later selection between the second pre-compiled operator and the second code-generating operator after additional information is available regarding whether a subsequent third operator is selected as either a third code-generating operator or a third pre-compiled operator;

continuing to generate the mixed query plan including the selection of the third operator;

selecting the second pre-compiled operator to replace the operator alternatives in response to the third operator being selected as a third pre-compiled operator;

selecting the second code-generating operator to replace the operator alternatives in response to the third operator being selected as a third code-generating operator; and

executing, by an execution engine, the mixed query plan using the selected one of the operator alternatives.

6. The method of claim 5 , wherein the second code-generating operator is associated with code which, when executed at runtime, generates additional code for compilation and execution as part of the mixed query plan.

7. The method of claim 5 , wherein when the selected one of the operator alternatives corresponds to the code-generated operator, the query plan optimizer inserts glue code into the mixed query plan, wherein the glue code decomposes one or more data chunks into a plurality of constituent rows of data.

8. The method of claim 5 , wherein the second pre-compiled operator operates on a different unit of data from the second code-generating operator.

9. A non-transitory computer-readable storage medium including program code which when executed by at least one data processor, result in operations comprising:

generating a mixed query plan including a first operator selected as either a first pre-compiled operator or a first code-generating operator and a second operator configured as operator alternatives, wherein the operator alternatives comprise a second pre-compiled operator and a second code-generating operator, and wherein the operator alternatives are configured to allow a later selection between the second pre-compiled operator and the second code-generating operator after additional information is available regarding whether a subsequent third operator is selected as either a third code-generating operator or a third pre-compiled operator;

continuing to generate the mixed query plan including the selection of the third operator;

selecting the second pre-compiled operator to replace the operator alternatives in response to the third operator being selected as a third pre-compiled operator;

selecting the second code-generating operator to replace the operator alternatives in response to the third operator being selected as a third code-generating operator; and

executing, by an execution engine, the mixed query plan using the selected one of the operator alternatives.

10. The non-transitory computer-readable storage medium of claim 9 , wherein the second code-generating operator is associated with code which, when executed at runtime, generates additional code for compilation and execution as part of the mixed query plan.

11. The non-transitory computer-readable storage medium of claim 9 , wherein when the selected one of the operator alternatives corresponds to the code-generated operator, the query plan optimizer inserts glue code into the mixed query plan, wherein the glue code decomposes one or more data chunks into a plurality of constituent rows of data.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 10, 2023
From: MERKER, TILL
To: SAP SE
Reel/Frame 063278/0437 →
Continuity (2)
Continuation 16372282 · Apr 1, 2019
Related Publication 20230244665A1 · Aug 3, 2023
References Cited (14)
US 10901990B1 · Vogelsgesang · 2021 [cited by examiner]
US 20070067274A1 · Han · 2007 [cited by examiner]
US 20090019000A1 · Arends · 2009 [cited by examiner]
US 20090228465A1 · Krishnamurthy · 2009 [cited by examiner]
US 20100198810A1 · Graefe · 2010 [cited by examiner]
US 20120173515A1 · Jeong · 2012 [cited by examiner]
US 20140136513A1 · Ailamaki · 2014 [cited by examiner]
US 20160078084A1 · Freedman · 2016 [cited by examiner]
US 20200201860A1 · Vogelsgesang · 2020 [cited by examiner]
US 20200210387A1 · Brown · 2020 [cited by examiner]
WO WO2011106006A1 · 2011 [cited by examiner]
WO WO2016088281A1 · 2016 [cited by examiner]
Herodotos Herodotou et al., “Query Optimization Techniques for Partitioned Tables”, SIGMOD '11: Proceedings of the 2011 ACM SIGMOD International Conference on Management of data, Jun. 2011, pp. 49-60. [cited by examiner]
Leonidas Fegaras et al., “Compile-Time Code Generation for Embedded Data-Intensive Query Languages”, IEEE International Congress on Big Data (BigData Congress), Jul. 2018, pp. 1-8. [cited by examiner]