Patent ID: 7356523

Claim:
A computer implemented method of managing a statement pool, the method comprising: accessing an unoptimized representation of a statement among a plurality of statements in a statement pool utilized by a database, wherein the unoptimized representation of the statement is a prepared statement; generating an optimized representation of the statement from the unoptimized representation of the statement, wherein the optimized representation of the statement is a prepared statement; replacing the unoptimized representation of the statement with the optimized representation of the statement in the statement pool; tracking usage of at least a subset of the plurality of statements, wherein the generating the optimized representation of the statement is performed based upon the tracked usage, and wherein the tracking usage includes tracking at least one of a number of times and a last time that each of the subset of statements is used; associating with the optimized representation of the statement a usage statistic generated for the unoptimized representation of the statement; generating a result set by initiating execution of the optimized representation of the statement; and returning the generated result set to a user or client computer.