Patent ID: 7120776

Claim:
A method for managing memory used for query execution, the method comprising the computer-implemented steps of: allocating a buffer map table with locations that correspond to a buffer pool in a cache memory; wherein the cache memory is managed by a cache memory manager; wherein the buffer map table is managed by a buffer pool manager that is distinct from said cache memory manager; wherein the buffer pool includes a plurality of buffers; in response to a need to cache a query working set of a query in the cache memory, the buffer pool manager allocating to the query working set a buffer from the buffer map table that corresponds to a buffer in the buffer pool, prior to generating said buffer map table, calculating working set memory requirements of an average query; generating an estimate of how many queries will be executing at a given time; determining how many buffers within the buffer pool are required to accommodate the average query based on the estimate of how many queries will be executing at a given time; generating the buffer map table based on the working set requirements of the average query and the estimate of how many queries will be executing at a given time.