Method for Optimization of Imperative Code Executing Inside a Relational Database Engine
US-2018329952-A1 · Nov 15, 2018 · US
US11023460B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-11023460-B2 |
| Application number | US-201715852559-A |
| Country | US |
| Kind code | B2 |
| Filing date | Dec 22, 2017 |
| Priority date | Dec 22, 2017 |
| Publication date | Jun 1, 2021 |
| Grant date | Jun 1, 2021 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
A User-Defined Function (UDF) provided by a user and accessed through a user query is identified. A wrapper for the UDF is generated. The wrapper represents a customized instance of the UDF. The wrapper, during execution, selectively calls the UDF provided by the user. Any query that references the UDF is rewritten to process the wrapper instead of the UDF.
Opening claim text (preview).
The invention claimed is: 1. A method, comprising: identifying a source code for a User-Defined Function (UDF) being created by a user in a Data Definition Language (DDL) statement; generating a new source code for the UDF; creating a wrapper source code representing an instance of the new source code that selectively calls the UDF; and processing an executable version of the instance when the UDF is called in a query, further including rewriting the query to call the instance instead of the UDF and replacing a GROUP BY clause in the query with a PARTITION BY clause. 2. The method of claim 1 , wherein identifying further includes identifying the UDF as an aggregate data function provided by the user in a CREATE clause of the DDL statement. 3. The method of claim 2 , wherein generating further includes generating the new source code as an aggregate table operator. 4. The method of claim 1 , wherein creating further includes changing a manner in which input data is passed to the UDF is processed within the wrapper source code. 5. The method of claim 4 , wherein changing further includes providing batching instructions within the wrapper source code to batch the input data before the wrapper code calls the UDF. 6. The method of claim 4 , wherein changing further includes providing buffering instructions within the wrapper source code for allocating at least one memory buffer for holding the input data before the wrapper code calls the UDF and for holding results produced by the calls to the UDF. 7. The method of claim 1 , wherein creating further includes rewriting the DDL statement to replace the UDF with the instance. 8. The method of claim 1 further comprising, dynamically processing the method within a database parser that interprets the query and generates executable query instructions for the query. 9. The method of claim 8 , wherein dynamically processing further includes transparently performing the method in a manner that the user is unaware of and where the UDF, the DDL statement, and the query remain unchanged from the perspective of the user. 10. A method, comprising: transparently generating a wrapper representing an instance of a User-Defined Function (UDF) in response to the User-Defined Function (UDF) being registered; registering the instance as a replacement for the UDF; and calling the instance when a query references the UDF, further including transparently rewriting the query to call the instance and replacing a GROUP BY clause that performs aggregation with a PARTITION by clause that performs an equivalent aggregation within the query. 11. The method of claim 10 , wherein transparently generating further includes altering how input data is passed to the UDF within the wrapper. 12. The method of claim 11 , wherein altering further includes providing a batching mechanism for batching the input data before passing to the UDF within the wrapper. 13. The method of claim 10 , wherein registering further includes transparently rewriting a Data Definition Language (DDL) statement that registered the UDF to replace the UDF with the instance. 14. The method of claim 10 further comprising, processing the method within a parser/optimizer of a database. 15. A system, comprising: a data warehouse including: a query parser; and a User-Defined Function (UDF) Wrapper; wherein the query parser is configured to i) execute on a hardware processor of a network computing device, ii) generate the UDF wrapper as an equivalent instance of a UDF in response to the UDF registered by a user with the data warehouse, and iii) provide instructions that processes the equivalent instance in place of the UDF when the UDF is called within a query; and wherein the query parser is further configured in ii) to change a mechanism in which input data is passed to the UDF within the UDF wrapper, register the equivalent instance with the data warehouse as a replacement to the UDF, and replace a GROUP BY clause that performs data aggregation when the query is processed with a PARTITION BY clause within the query, wherein the PARTITION BY clause performs an equivalent data aggregation as the data aggregation.
Source to source · CPC title
Grouping and aggregation · CPC title
Parsing · CPC title
for particular applications; for extensibility, e.g. user defined types · CPC title
User-Defined Types; Storage management thereof · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.