The SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS system procedure turns a connection's runtime statistics on or off.
By default, the runtime statistics are turned off. When the runtimestatistics attribute is turned on, Derby maintains information about the execution plan for each statement executed within the connection (except for COMMIT) until the attribute is turned off. To turn the runtimestatistics attribute off, call the procedure with an argument of zero. To turn the runtimestatistics on, call the procedure with any non-zero argument.
For statements that do not return rows, the object is created when all internal processing has completed before returning to the client program. For statements that return rows, the object is created when the first next() call returns 0 rows or if a close() call is encountered, whichever comes first.
SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(IN SMALLINT ENABLE)
By default, all users have execute privileges on this procedure.
-- establish a connection -- turn on RUNTIMESTATISTIC for connection: CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1); -- execute complex query here -- step through the result sets -- access runtime statistics information: CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(0);