Method and apparatus for reducing the memory required to store bind variable descriptors in a database
First Claim
1. A method for executing queries on a server, said method comprising the computer implemented steps of:
- storing in a first memory space a first private object for executing a first query from one or a set of clients, wherein said first private object is private to said first query;
storing in a second memory space a first shared object;
storing in said first shared object data describing attributes of a set of bind variables for a particular query;
storing in said first private object data establishing a link to said first shared object;
if differences exist between attributes of a set of bind variables for said first query and attributes of the set of bind variables for said particular query, then storing data in said first private object indicating the differences between attributes of the set of bind variables for said first query and attributes of the set of bind variables for said particular query;
generating compiled code required to execute said particular query;
storing said compiled code in said first shared object; and
executing said first query using the data and the compiled code stored in said first shared object, as well as the data stored in said first private object.
2 Assignments
0 Petitions
Accused Products
Abstract
The present invention discloses a method and apparatus for reducing the memory required to store bind variable descriptors in a database system. In embodiments of the invention, bind variable descriptors continue to be maintained in the shared cursor objects, but bind variables are no longer maintained in the instantiation objects. If the bind variables associated with an instantiation object are accurately described by the bind variable descriptors in a shared object to which the instantiation object is linked, then only data indicating the bind variables associated with the instantiation object are accurately described is maintained in the instantiation object. In contrast, if the bind variable descriptors associated with an instantiation object are not accurately described, only data describing how the attributes of the bind variables associated with the instantiation object differ from those associated with the shared cursor object are maintained in the instantiation object.
113 Citations
32 Claims
-
1. A method for executing queries on a server, said method comprising the computer implemented steps of:
-
storing in a first memory space a first private object for executing a first query from one or a set of clients, wherein said first private object is private to said first query; storing in a second memory space a first shared object; storing in said first shared object data describing attributes of a set of bind variables for a particular query; storing in said first private object data establishing a link to said first shared object; if differences exist between attributes of a set of bind variables for said first query and attributes of the set of bind variables for said particular query, then storing data in said first private object indicating the differences between attributes of the set of bind variables for said first query and attributes of the set of bind variables for said particular query; generating compiled code required to execute said particular query; storing said compiled code in said first shared object; and executing said first query using the data and the compiled code stored in said first shared object, as well as the data stored in said first private object. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A method for storing data describing attributes of bind variables for a first query, said method comprising the computer-implemented steps of:
-
A) receiving a request to create a cursor for said first query, wherein the data accessible using said cursor is the data in a database that satisfies said first query; B) allocating a first set of one or more memory areas for storing data for said cursor; D) determining if one of a plurality of objects can be used to execute said first query, wherein each object in said plurality of objects is for storing data and compiled code for executing a query associated with said object, wherein each object of said plurality of objects has stored therein a set of data describing attributes of the bind variables for said query associated with said object; and E) if one of said plurality of objects can be used to execute said first query, then performing the steps of; E1) Selecting as a selected object the one of said plurality of objects that can be used to execute said first query; E2) if differences exist between attributes of the bind variables for said first query and attributes of the bind variables for the query associated with said selected object, then storing data in said first set of one or more memory areas indicating how attributes of the bind variables for said first query differ from attributes of the bind variables for the query associated with said selected object; and B3) storing in said first set of one or more memory areas data associating said cursor with said selected object. - View Dependent Claims (14, 15, 16, 17, 18, 19)
-
-
20. A method for executing queries on a server, said method comprising the computer implemented steps of:
-
storing in a first memory space a first private object for executing a first query from one of a set of clients, wherein said first private object is private to said first query; storing in a second memory space a first shared object; storing in said first shared object data describing attributes of a set of bind variables for said first query; storing in said first private object data establishing a link to said first shared object; generating compiled code required to execute said first query; storing said compiled code in said first shared object; executing said first query using the data and the compiled code stored in said first shared object, as well as the data stored in said first private object; storing in a third memory space a second private object for executing a second query from one of said set of clients, wherein said second private object is private to said second query; determining that the execution of said first query or said second query can be performed by executing the same compiled code; storing in said second private object data establishing a link to said first shared object; if differences exist between attributes of a set of bind variables for said second query and attributes of the set of bind variables for said first query, then storing data in said second private object indicating the differences between attributes of the set of bind variables for said second query and attributes of the set of bind variables for said first query; and executing said second query using the data and the compiled code stored in said first shared object, as well as the data stored in said second private object. - View Dependent Claims (21, 22, 23, 24, 25)
-
-
26. A database system comprising:
-
a set of one or more memory devices; a shared object stored in said set of one or more memory devices; data storing in said shared object describing attributes of a set of bind variables for a particular query; compiled code stored in said shared object, said compiled code for executing said particular query; a first private object stored in said set of one or more memory devices, said first private object being private to a client that requested execution of a first query, said first private object not having stored therein attributes of a set of bind variables for said first query; data stored in said first private object establishing a link to said shared object; and a first series of one or more instructions, which when executed by one or more processors, causes said one or more processors to execute said first query using said shared object and said first private object. - View Dependent Claims (27, 28, 29, 30, 31, 32)
-
Specification