主权项 |
1. A computer-implemented method for optimizing a database query of a database in a computer system, comprising:
using a cost model to generate at least one database query execution plan of the database; monitoring, in the computer system, current resource usage of one or more resources of the computer system required to execute the at least one database query execution plan, as a measure of current level of usage of the one or more resources; storing, in the computer system, a condition code representative of the monitored current resource usage based on the measure of the current level of the usage of the one or more resources; modifying, in the computer system, the cost model using the stored condition code determined based on the measure of the current level of the usage of the one or more resources required to the at least one query execution plan, by at least modifying at least one cost associated with at least one of the one or more resources in order to obtain a modified cost model; generating, in the computer system, a query execution plan for at least one database query using the modified cost model as modified based on the measure of the current usage of the one or more resources required to the at least one query execution plan; and executing, in the computer system, the query execution plan. |