DB2 Top 10 SQL by Execution Time


How to obtain the db2 top 10 SQL sorted by Execution time on your database?


db2 "SELECT AVERAGE_EXECUTION_TIME_S as TIME_SECONDS, NUM_EXECUTIONS as EXECUTIONS, STMT_TEXT as TEXT FROM SYSIBMADM.TOP_DYNAMIC_SQL WHERE upper(STMT_TEXT) like 'SELECT%' ORDER BY AVERAGE_EXECUTION_TIME_S DESC FETCH FIRST 10 ROWS ONLY"

 
I hope you find it useful!

If you like this post write a comment or subscribe you to our feed to obtain future posts in your feed reader.

Comments

No comments.

Add a comment

(required)

(required)