18. Monitoring : View Query Profile Information
 
Share this page                  
View Query Profile Information
Information on the execution plan of recent queries can be accessed through the following predefined views:
iivwquery
iivwprof
iivwprof_last
The views provide detailed information about query performance including run time, I/O statistics, number of tuples retrieved, and timings for every step of the query execution. Statistics about the query execution are gathered at the end of the query, even if the query is canceled.
To access a profiling view
1. Connect to the database. For example:
sql mydb
Note:  If connecting to a remote server, you must use vnode syntax. For details, see Connecting to a Remote Server in the Getting Started guide.
2. Run a query.
3. Select data from the desired profiling view. For example:
SELECT * FROM iivwprof_last
Note:  Views with the name iivwprof_*_global (for example iivwquery_global) contain information on all sessions (not only the current session). Views iivwquery_global and iivwprof_global have an additional attribute "session_id", which is an 8-byte integer.