SQL code generation for heterogeneous environment
First Claim
1. A method for generating machine executable code for implementing a query of a database, the database having tables and records of data, comprising the steps of:
- receiving a subject query;
forming an execution plan corresponding to the subject query, the execution plan having a sequence of pieces and corresponding processes for implementing the pieces; and
for at least one piece of the plan, (a) generating source code using different code generation techniques as a function of an expected processing machine type; and
(b) compiling the generated source code to form machine executable code for implementing the subject query, said generated source code thereby avoiding runtime interpretation of the pieces in the execution plan.
8 Assignments
0 Petitions
Accused Products
Abstract
This invention relates generally to a system for processing database queries, and more particularly to a method for generating high level language or machine code to implement query execution plans. In one preferred embodiment, the method begins by receiving a subject query, and then forming an execution plan corresponding to the subject query. The execution plan will typically have a sequence of component snippets or pieces and corresponding processes for implementing the pieces. For at least one piece in the plan, the process then (a) generates source code using different code generation techniques as a function of expected runtime processing machine types; and then (b) compiles the generated source code to form machine executable code for implementing the subject query. As a result, the query executed directly as machine executable code thereby avoiding runtime interpretation of the pieces in the execution plan.
-
Citations
19 Claims
-
1. A method for generating machine executable code for implementing a query of a database, the database having tables and records of data, comprising the steps of:
- receiving a subject query;
forming an execution plan corresponding to the subject query, the execution plan having a sequence of pieces and corresponding processes for implementing the pieces; and
for at least one piece of the plan, (a) generating source code using different code generation techniques as a function of an expected processing machine type; and
(b) compiling the generated source code to form machine executable code for implementing the subject query, said generated source code thereby avoiding runtime interpretation of the pieces in the execution plan. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18)
- receiving a subject query;
-
10. A method for generating machine executable code for implementing a query of a database, the database having tables and records of data, comprising the steps of:
-
receiving a subject query;
forming an execution plan corresponding to the subject query, the execution plan having a sequence of pieces and corresponding processes for implementing the pieces; and
for at least several identified pieces of the plan, (a) generating source code for the several identified pieces of the plan, with the source code generated for at least one identified subsequent piece of the plan being dependent upon the results of code generated for a another identified prior piece of the plan to be executed prior to the identified piece of the plan; and
(b) compiling the generated source code to form machine executable code for implementing the subject query, said generated source code thereby avoiding runtime interpretation of the at least several pieces in the execution plan. - View Dependent Claims (11, 12, 13)
-
-
19. A system for processing a query on a database comprising:
-
a plurality of database operation processor components, with at least two of the database operation processor components having different operation processing capabilities, such that the database operation processor components provide at least two different locales for executing database operations, with the two locales having different operation processing capabilities and such that more than one database operation processor component locale is capable of executing a given selected database operation;
a database catalog comprising database table information, database operation processor component locale information, and database operation processor characteristic information;
a query optimizer receiving the query and accessing the database catalog to develop a query execution plan, the query execution plan defining two or more plan pieces that include database operations to carry out the query, and the query execution plan also defining a respective database operation processor component locale at which to carry out each such database operation in the query execution plan, by comparing the processing capabilities of the different locale types for the database operation; and
for at least one piece of the query execution plan,(a) generating source code using different code generation techniques as a function of specified locale types; and
(b) compiling the generated source code to form machine executable code for implementing the query execution plan, said generated source code thereby avoiding runtime interpretation of the plan pieces.
-
Specification