SYSCS_UTIL.SYSCS_SET_XPLAIN_MODE system procedure

When runtime statistics are being captured, you can control the mode of processing by using the SYSCS_UTIL.SYSCS_SET_XPLAIN_MODE procedure.

When the XPLAIN mode is set to 1, statements are compiled and optimized, but not executed; when the XPLAIN mode is set to 0 (the default), statements are compiled, optimized, and executed normally.

The XPLAIN mode only matters when XPLAIN style has been enabled. See the SYSCS_UTIL.SYSCS_SET_XPLAIN_SCHEMA system procedure for more information.

See "Working with RunTimeStatistics" in Tuning Derby for additional information.

Syntax

SYSCS_UTIL.SYSCS_SET_XPLAIN_MODE(IN SMALLINT NOEXECUTE)

Execute privileges

If authentication and SQL authorization are both enabled, only the database owner has execute privileges on this procedure by default. See "Enabling user authentication" and "Setting the SQL standard authorization mode" in the Derby Developer's Guide for more information. The database owner can grant access to other users.

Example

To let Derby explain a statement without executing it:

        call syscs_util.syscs_set_runtimestatistics(1);
        call syscs_util.syscs_set_xplain_schema('STATS');
        call syscs_util.syscs_set_xplain_mode(1);

        select country from countries;

        call syscs_util.syscs_set_runtimestatistics(0);
        call syscs_util.syscs_set_xplain_schema('');
        call syscs_util.syscs_set_xplain_mode(0);
Related reference
SYSCS_UTIL.SYSCS_GET_XPLAIN_MODE system function
SYSCS_UTIL.SYSCS_GET_XPLAIN_SCHEMA system function
SYSCS_UTIL.SYSCS_SET_XPLAIN_SCHEMA system procedure