Multiple statements can be compiled using the same optimization profile.
To make optimization profile processing more efficient, the optimization profile is processed the first time it is used to optimize a statement, and the output is stored in the optimization profile cache. Subsequent references to the optimization profile use the processed version in the optimization profile cache.
An optimization profile should be removed from the optimization profile cache when the version stored in SYSTOOLS.OPT_PROFILE has been updated. When the old version is removed from the cache, the new version will be used upon optimization of subsequent statements that use the optimization profile.
This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared.
The privileges held by the authorization ID of the statement must include either SQLADM or DBADM authority (SQLSTATE 42502).
.-ALL---------------------------. >>-FLUSH OPTIMIZATION PROFILE CACHE--+-+---------------------------+-+->< '-optimization-profile-name-'
SET CURRENT SCHEMA = '"Rick"'
FLUSH OPTIMIZATION PROFILE CACHE "Foo"
SET CURRENT SCHEMA = '"Rick"'
FLUSH OPTIMIZATION PROFILE CACHE JOHN.ALL