Query History Table

If you are the user admin, you can use the nzstats command to display the Query History Table, which displays information about the last 15000 completed queries. You can use the system view _v_qryhist to view recent history data. For more information, see Table 2.

The Query History Table uses the _v_qrystat view for compatibility with an earlier release and will be deprecated in a future release. For more information, see Collecting data history.

The Query History Table has the following columns:
Table 1. Query History Table
Column Description
Query Id The ID of the query.
Session Id The ID of the session that initiated this query.
Plan Id The internal ID of the plan that is associated with this query
Client ID The internal client ID associated with the query's session.
Db Id The database ID from which this query is running.
User Id The user name.
Client IP Addr The client IP address.
SQL Statement The SQL statement. You can see the entire string by increasing the width of the column.
Submit Date The date and time that the query was submitted.
Start Date The date and time that the query started running.
End Date The date and time that the query completed.
Elapsed Time The estimated elapsed time, as determined by the optimizer.
Priority The priority number.
Priority Text The priority text string.
Estimated Cost The estimated seconds, as determined by the optimizer.
Estimated Disk The estimated disk usage, as determined by the optimizer.
Estimated Mem The estimated memory usage, as determined by the optimizer.
Snippets The number of snippets (steps) in the plan for this query.
Snippets Done The number of snippets processed.
Result Rows The number of rows in the result.
Result Bytes The number of bytes in the result.