1.0

Table Of Contents
4. Exit sqlf:
exit;
See SQLFire Query Execution Plan Codes on page 262 for information about individual codes displayed in the
query plan output.
Capture Query Execution Plans for All Statements
As an alternative to using the EXPLAIN command, you use built-in system procedures to enable and disable
query execution plan and statistics capture for all statements that you execute on a connection.
Procedure
1. Establish a peer client or thin client connection to the SQLFire cluster. For example:
sqlf
connect peer 'host-data=false;mcast-port=12777';
2. Use the SYSCS_UTIL.SET_EXPLAIN_CONNECTION procedure to begin capturing query execution plans
for queries on this connection:
call SYSCS_UTIL.SET_EXPLAIN_CONNECTION(1);
3. Use the SYSCS_UTIL.SET_STATISTICS_TIMING procedure to also capture query statistics information
at a specied interval. For example:
call SYSCS_UTIL.SET_STATISTICS_TIMING(1);
4. Execute the queries of interest and step through the result set of each query.
5. Disable query plan capture:
call SYSCS_UTIL.SET_EXPLAIN_CONNECTION(0);
call SYSCS_UTIL.SET_STATISTICS_TIMING(0);
6. Exit sqlf:
exit;
After you have captured query execution plans, you can use a peer client connection to query the captured plans.
View Query Plans and Statistics
After you have captured one or more query plans, you can view the contents of an individual plan from a peer
client connection.
The contents of SQLFire query plans are similar to those found in Apache Derby. See SQLFire Query Execution
Plan Codes on page 262 and Derby Tuning in the Apache Derby documentation for more information about
interpreting query plans.
Procedure
1. Establish a peer client connection to the SQLFire cluster. For example:
sqlf
connect peer 'host-data=false;mcast-port=12777';
Note: This release of SQLFire does not support using the EXPLAIN command from a thin client
connection. Use a peer client connection instead, as shown in this example command.
vFabric SQLFire User's Guide260
Managing and Monitoring vFabric SQLFire