Patent ID: 7289978

Claim:
A computer-implemented method for promoting reuse of previously generated access plans by a database management system (DBMS), wherein the previously generated access plans correspond with previously processed database query language statements, the method comprising: receiving a database query language statement, wherein said database query language statement is Structured Query Language (SQL); amending said database query language statement with a parameter marker substituted for a literal, wherein said parameter marker has a same data type as said literal, wherein the received database query language statement and the amended database query language statement differ only in a value of one or more literals, wherein the amended database query language statement is a functional equivalent to a previously processed database query language statement thereby allowing a reuse of a previously generated access plan; providing a substitution indicator to said DBMS indicating that substitution of said parameter marker for said literal has been performed, wherein said substitution indicator includes a flag passed to said DBMS using a client/server protocol; determining soundness of the substitution that is performed, wherein soundness is measured in terms of semantic correctness of the amended query language statement and the likelihood that the literal will improve DBMS efficiency, wherein the assessing comprises a trailing wildcard test and an overloaded function parameter test, wherein the trailing wildcard test determines if the substituted parameter marker includes a trailing wildcard character, wherein the trailing wildcard character is indicated by rows that do not match a hard-coded prefix of the literal, wherein the overloaded function parameter test determines if the substituted parameter marker includes a parameter to a function with an overloaded function name; providing an original database query language statement to said DBMS for access plan selection when an indication from said DBMS that said substitution was unsound is received; and providing said amended database query language statement and the parameter comprising the substituted literal to said DBMS for access plan selection; and selecting for reuse the previously generated access plan corresponding to the previously processed database query language statement functionally equivalent to said amended database query language statement.