Patent ID: 7502775

Claim:
A method for providing cost data for tuning a size of a query cache in a database system, the method comprising: receiving a query; checking a query cache to determine whether a stored query matches the received query; and in response to a cache miss occurring due to no stored query matching the received query: generating a token from the received query, wherein the token represents the received query and checking whether the generated token matches a token stored in a simulation area of storage, wherein a plurality of tokens are stored in the simulation area of storage, each of the tokens representing a query object that was previously evicted from the query cache, determining a processing time saved by an avoidance of the cache miss, and determining a cache size needed to avoid the cache miss, wherein the determining of the cache size needed to avoid the cache miss is performed only when the generated token matches a token stored in the simulation area of storage, wherein the cache size needed to avoid the cache miss is determined by summing sizes of all the query objects represented by the tokens stored in the simulation area of storage, wherein the summed query objects are a same age or older than the query object represented by the matching token, wherein each token stored in the simulation area of storage is included in a stub that also includes the size of the query object represented by the token, and an identification number indicating an order in which the token was stored in the simulation area of storage.