onstat -g qplan command: Print running query and its plan
Use the onstat -g qplan command to display the currently running query and its plan.
You can specify one of the following invocations:
| Invocation | Explanation |
| onstat -g qplan | Displays the running query and its plan for each session. |
| onstat -g qplan sessionid | Displays the running query and its plan for the session that you specify. |
Example output
select * from systables a, systables b;
onstat –g qplan command output:
Session [36]: No running query to generate the plan.
Session [33]: No running query to generate the plan.
Session [32]: No running query to generate the plan.
Session [31]: No running query to generate the plan.
Session [30]: No running query to generate the plan.
Session [28]
QUERY:
------
select * from systables a , systables b
Estimated Cost: 8779
Estimated # of Rows Returned: 73984
1) informix.b: SEQUENTIAL SCAN
2) informix.a: SEQUENTIAL SCAN
NESTED LOOP JOIN
Session [3]: No running query to generate the plan.
Session [2]: No running query to generate the plan.