1.1

Table Of Contents
Example
This statement captures a query plan in SYS.STATEMENTPLANS:
EXPLAIN select * from flights f, flightavailability fa where
f.flight_id = fa.flight_id;
You can see the statement ID for the query execution plan by querying the system table:
sqlf> select STMT_ID, STMT_TEXT from SYS.STATEMENTPLANS;
STMT_ID |STMT_TEXT
--------------------------------------------------------------------------------------------------------------------------------------------------------------
00000001-ffff-ffff-ffff-00010000052d| select * from flights
f, flightavailability fa where f.flight_id = fa.flight_id
00000001-ffff-ffff-ffff-00010000051e| select * from flights
f, flightavailability fa where f.flight_id=fa.flight_id and
f.flight_id=<?>
00000001-ffff-ffff-ffff-00010000050f| select * from flights
f, flightavailability fa where f.flight_id=fa.flight_id and
f.flight_id=<?>
3 rows selected
To view the actual query execution plan, connect as a peer to the SQLFire system and
execute the EXPLAIN command with the statement ID:
sqlf> connect peer
'host-data=false;locators=mylocator[10334]';
sqlf> explain '00000001-ffff-ffff-ffff-00010000052d';
stmt_id 00000001-ffff-ffff-ffff-00010000052d SQL_stmt
select * from flights f, flightavailability fa where
f.flight_id = fa.flight_id begin_execution 2013-01-30
15:45:19.707 end_execution 2013-01-30 15:45:19.935
QUERY-SCATTER execute_time 96.327 ms member_node
peridot(38733):2790
QUERY-SEND execute_time 0.187 ms member_node
peridot(38733):2790
RESULT-RECEIVE execute_time 0.258 ms member_node
peridot(38733):2790
SEQUENTIAL-ITERATION (10.86%) execute_time 13.415 ms
returned_rows 594 no_opens 1
RESULT-HOLDER execute_time 11.334 ms returned_rows
594 no_opens 1 member_node peridot(38733):2790
DISTRIBUTION-END (89.13%) execute_time 110.059 ms
returned_rows 594
member peridot(38733):2790 begin_execution 2013-01-30
15:45:19.708 end_execution 2013-01-30 15:45:19.801
QUERY-RECEIVE execute_time 92.916 ms member_node
peridot(38741)<v1>:27275
RESULT-SEND execute_time 0.279 ms member_node
peridot(38741)<v1>:27275
RESULT-HOLDER execute_time 76.247 ms returned_rows 594
no_opens 1
PROJECTION (3.95%) execute_time 2.249 ms returned_rows
594 no_opens 1 node_details SELECT :FLIGHT_ID SEGMENT_NUMBER
ORIG_AIRPORT DEPART_TIME DEST_AIRPORT ARRIVE_TIME MEAL
FLYING_TIME MILES AIRCRAFT FLIGHT_ID SEGMENT_NUMBER
FLIGHT_DATE ECONOMY_SEATS_TAKEN BUSINESS_SEATS_TAKEN
FIRSTCLASS_SEATS_TAKEN
501
SQL Language Reference