Code generation for queries in a database system
First Claim
1. A method, comprising:
- obtaining a user query in a query language, the user query comprising at least one query parameter for selecting data from a content database;
obtaining machine code that is executable directly by a processing system, corresponding to a compiled version of the user query, by;
parsing the user query to identify a skeletal form of the user query in the structured query language;
generating byte code defining a plurality of functions corresponding to a compiled version of the skeletal form of the user query, andobtaining the machine code corresponding to the compiled version of the user query based on the byte code, by retrieving compiled machine code for the byte code defining one or more of the plurality of functions if available or generating machine code for the byte code defining one or more of the plurality of functions when not available;
wherein the machine code corresponding to the compiled version of the user query comprises at least one unresolved symbol and obtaining the machine code comprises;
retrieving a memory address at which additional machine code corresponding to the at least one unresolved symbol is stored;
replacing the at least one unresolved symbol with the corresponding memory address; and
executing the machine code corresponding to the compiled version of the user query using the at least one query parameter, thereby returning a result of the user query satisfying the at least one query parameter.
7 Assignments
0 Petitions
Accused Products
Abstract
A method for generating code for queries in a database system includes obtaining a user query in a first programming language, the user query comprising at least one query parameter for selecting data from a content database. The method includes obtaining machine code corresponding to a compiled version of the user query. Obtaining the machine code includes generating code in a second programming language corresponding to a compiled version of the user query, generating byte code defining a plurality of functions corresponding to a compiled version of the code in the second programming language, and obtaining the machine code corresponding to the compiled version of the user query based on the byte code. The method further comprises executing the machine code using the at least one query parameter, thereby returning a result satisfying the at least one query parameter. A related non-transitory computer-readable medium and system are also provided.
-
Citations
12 Claims
-
1. A method, comprising:
-
obtaining a user query in a query language, the user query comprising at least one query parameter for selecting data from a content database; obtaining machine code that is executable directly by a processing system, corresponding to a compiled version of the user query, by; parsing the user query to identify a skeletal form of the user query in the structured query language; generating byte code defining a plurality of functions corresponding to a compiled version of the skeletal form of the user query, and obtaining the machine code corresponding to the compiled version of the user query based on the byte code, by retrieving compiled machine code for the byte code defining one or more of the plurality of functions if available or generating machine code for the byte code defining one or more of the plurality of functions when not available; wherein the machine code corresponding to the compiled version of the user query comprises at least one unresolved symbol and obtaining the machine code comprises; retrieving a memory address at which additional machine code corresponding to the at least one unresolved symbol is stored; replacing the at least one unresolved symbol with the corresponding memory address; and executing the machine code corresponding to the compiled version of the user query using the at least one query parameter, thereby returning a result of the user query satisfying the at least one query parameter. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A non-transitory computer readable medium comprising instructions which, when executed by a processing system, causes the processing system to:
-
obtain a user query in a query language, the user query comprising at least one query parameter for selecting data from a content database; obtain machine code that is executable directly by a processing system, corresponding to a compiled version of the user query, by; parsing the user query to identify a skeletal form of the user query in the structured query language; generating byte code defining a plurality of functions corresponding to a compiled version of the skeletal form of the user query, and obtaining the machine code corresponding to the compiled version of the user query based on the byte code, by retrieving compiled machine code for the byte code defining one or more of the plurality of functions if available or generating machine code for the byte code defining one or more of the plurality of functions when not available; wherein the machine code corresponding to the compiled version of the user query comprises at least one unresolved symbol and obtaining the machine code comprises; retrieving a memory address at which additional machine code corresponding to the at least one unresolved symbol is stored; replacing the at least one unresolved symbol with the corresponding memory address; and execute the machine code corresponding to the compiled version of the user query using the at least one query parameter, thereby returning a result of the user query satisfying the at least one query parameter. - View Dependent Claims (8, 9, 10, 11)
-
-
12. A system comprising:
-
a code database; a content database; and a processing system configured to; obtain a user query in a query language, the user query comprising at least one query parameter for selecting data from a content database; obtain machine code that is executable directly by a processing system, corresponding to a compiled version of the user query, by; parsing the user query to identify a skeletal form of the user query in the structured query language; generating byte code defining a plurality of functions corresponding to a compiled version of the skeletal form of the user query, and obtaining the machine code corresponding to the compiled version of the user query based on the byte code, by retrieving compiled machine code for the byte code defining one or more of the plurality of functions if available or generating machine code for the byte code defining one or more of the plurality of functions when not available; wherein the machine code corresponding to the compiled version of the user query comprises at least one unresolved symbol and obtaining the machine code comprises; retrieving a memory address at which additional machine code corresponding to the at least one unresolved symbol is stored; and replacing the at least one unresolved symbol with the corresponding memory address; and execute the machine code corresponding to the compiled version of the user query using the at least one query parameter, thereby returning a result of the user query satisfying the at least one query parameter.
-
Specification