Patent ID: 8694486

Claim:
A computer program product for a query of data, the computer program product comprising: a computer readable storage medium having computer usable program code embodied therewith, the computer usable program code comprising a computer usable program code configured to: receive the query for data, the query including a deadline for completion; set a maximum resource usage parameter for the query; determine a plurality of access plans for the query; determine if any of the plurality of access plans can complete the query prior to the deadline for completion without exceeding the maximum resource usage indicated by the maximum resource usage parameter; upon determining that no access plan can complete the query prior to the deadline for completion, increase the maximum resource usage parameter for the query; determine a subset of the plurality of access plans that can be completed before the deadline for completion; and select an access plan from the subset of access plans, wherein the access plan is selected to provide a lowest resource usage among the subset of access plans that can be completed prior to the deadline for completion.