When runtime statistics are being captured, you can control the mode of processing using this 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.

Note that 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 the Tuning Java DB for additional information.



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 Java DB Developer's Guide for more information. The database owner can grant access to other users.


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);