Dynamically Selecting Alternative Query Access Plans
First Claim
1. A method of providing fee-based processing in a processor system, whereby fees are based on additional computer resources being added for enabling provision of alternative query access plans, the processor system including at least one processor;
- a memory coupled to the at least one processor, a query optimizer residing in the memory; and
, a manager residing in the memory and executable by the at least one processor, said method comprising the steps of;
generating with said query optimizer a first query access plan for executing a query, said first query access plan being generated with said query optimizer based on a first set of computer resources to be used for executing said query;
evaluating said first query access plan by determining whether additional computer resources are available to execute said query, said additional computer resources being computer resources in addition to said first set of computer resources;
dynamically selecting an alternative query access plan for executing said query responsive to determining that said additional computer resources are available to execute said first query and responsive to determining that at least a parameter value of the alternative query access plan exceeds a corresponding parameter value of the first query access plan, whereby the alternative query access plan is improved over the first query access plan, said alternative query access plan being based on an alternative set of computer resources which includes said additional computer resources to be used for executing the query; and
dynamically adding the computer resources for running the dynamically selected alternative query access plan, wherein the manager dynamically adds the computer resources based on determining the cost for usage for the additional computer resources.
0 Assignments
0 Petitions
Accused Products
Abstract
A query access plan for executing a database query is dynamically selected from among multiple alternative query access plans based on the availability of computer resources allocated for running the query. Preferably, a first query access plan is generated based on resources then available, and if it is possible to provide additional resources, one or more alternative plans are generated based on the additional resources. If an alternative plan is significantly better than the original plan based on a comparison of query related parameters, the alternative is chosen for executing the query. Additional resources for running the query may be provided from logically partitioned and/or grid environments.
-
Citations
9 Claims
-
1. A method of providing fee-based processing in a processor system, whereby fees are based on additional computer resources being added for enabling provision of alternative query access plans, the processor system including at least one processor;
- a memory coupled to the at least one processor, a query optimizer residing in the memory; and
, a manager residing in the memory and executable by the at least one processor, said method comprising the steps of;
generating with said query optimizer a first query access plan for executing a query, said first query access plan being generated with said query optimizer based on a first set of computer resources to be used for executing said query;
evaluating said first query access plan by determining whether additional computer resources are available to execute said query, said additional computer resources being computer resources in addition to said first set of computer resources;
dynamically selecting an alternative query access plan for executing said query responsive to determining that said additional computer resources are available to execute said first query and responsive to determining that at least a parameter value of the alternative query access plan exceeds a corresponding parameter value of the first query access plan, whereby the alternative query access plan is improved over the first query access plan, said alternative query access plan being based on an alternative set of computer resources which includes said additional computer resources to be used for executing the query; and
dynamically adding the computer resources for running the dynamically selected alternative query access plan, wherein the manager dynamically adds the computer resources based on determining the cost for usage for the additional computer resources.
- a memory coupled to the at least one processor, a query optimizer residing in the memory; and
-
2. A method for determining a query access plan for executing a query, comprising the computer-implemented steps of:
-
automatically generating with a query optimizer a first query access plan for executing said query, said first query access plan being generated with said query optimizer based on a first set of computer resources to be used for executing said query;
subsequently determining that a second set of computer resources is available to execute said query, said second set including at least some computer resources not included in said first set;
responsive to said step of subsequently determining that a second set of computer resources is available to execute said query, automatically generating with said query optimizer a second query access plan for executing said query, said second query access plan being different from said first query access plan, said second query access plan being generated with said query optimizer based on said second set of computer resources to be used for executing said query. - View Dependent Claims (3, 4, 5, 6, 7, 8, 9)
-
Specification