Optimization of queries using retrieval status of resources used thereby
AssigneeInternational Business Machines Corporation
InventorsPaul Day, Brian Muras
Life of this patent
Estimating the term…
Abstract
An apparatus, program product and method utilize the retrieval status of a resource to generate an access plan for a database query that uses the resource. The retrieval status, which indicates, for example, what percentage of a given resource is already stored in working memory, and thus need not be separately retrieved during query execution, may be used to generate more accurate input/output cost estimates for access plans, and thus enable a query optimizer to better select an access plan that is optimal under given runtime conditions.
Claims30
A method of performing a database query, the method comprising:
- generating an access plan for the database query, the access plan using at least one resource capable of being retrieved into working memory, wherein the resource is selected from the group consisting of a database file, a database table, an index, a temporary result set, a temporary file, and a hash table;
- estimating a percentage of the resource that is currently resident in working memory;
- estimating a cost for the access plan using the estimated percentage;
- and
- selectively executing the access plan based upon the estimated cost.
A method of optimizing a database query, the method comprising:
- determining a retrieval status for a resource used by the database query;
- and
- generating an access plan for the database query using the determined retrieval status for the resource.
An apparatus, comprising:
- at least one processor;
- a memory that includes a working memory;
- and
- program code resident in the memory and configured to be executed by the at least one processor to optimize a database query by determining a retrieval status for a resource used by the database query, and generating an access plan for the database query using the determined retrieval status for the resource.
A program product, comprising:
- program code configured to optimize a database query by determining a retrieval status for a resource used by the database query, and generating an access plan for the database query using the determined retrieval status for the resource;
- and
- a computer readable signal bearing medium bearing the program code.
Dependencies are inferred from the claim text.