Reoptimizing SPL routines
You can run an SQL statement that reoptimizes an SPL routine to prevent automatic reoptimization.
If you do not want to incur the cost of automatic reoptimization when you first execute an SPL routine after one of the situations that Automatic reoptimization lists, execute the UPDATE STATISTICS statement with the FOR PROCEDURE clause immediately after the situation occurs. In this way, the SPL routine is reoptimized before any users execute it.
To prevent unnecessary reoptimization of all SPL routines,
ensure that you specify a specific procedure name in the FOR PROCEDURE
clause.
UPDATE STATISTICS FOR PROCEDURE myroutine;
For guidelines to run UPDATE STATISTICS, see Update statistics when they are not generated automatically.