Patent ID: 7483918

Claim:
A computer implemented method comprising: dynamically capturing a workload subset and related statistics from a query workload executing against a database of a database server; compressing the workload subset on the database server, and storing the workload subset and the statistics in a memory on the database server, wherein the compressing comprises identifying a query template, grouping queries belonging to the query template, and including within the workload subset only a portion of those queries having a greatest cost that belong to the query template; maximizing a cost of the portion of the queries included within the workload subset, wherein the maximizing comprises determining an average execution cost for each query belonging to a query template based on that query's frequency of access to database objects, and evicting a query having a least average execution cost from the workload subset; limiting the size of the workload subset and the statistics based on a memory constraint, wherein the limiting comprises allocating an amount of memory for storing queries from the query workload, and evicting queries having the least cost from the memory when the allocated amount of memory is exceeded; transferring the workload subset and the statistics to a database tuning component remote from the database server, wherein the database tuning component comprises a feedback tuning loop and a monitoring component; determining a physical design with the database tuning component, wherein the physical design is applicable to the query workload executing against the database and is determined based on the workload subset and the statistics, wherein the determining a physical design comprises minimizing a cost of executing queries in the workload subset subject to a constraint that no query shall degrade in performance if that query is within the query workload but not within the workload subset; determining an estimated cost of executing the workload subset against the database using the physical design; and reporting the physical design and the estimated cost to a database administrator.