DB2 Top 10 SQL by Number of Executions


How to obtain the top 10 SQL sorted by number of executions on your database?


db2 "SELECT NUM_EXECUTIONS as EXECUTIONS, AVERAGE_EXECUTION_TIME_S as TIME_SECONDS, STMT_TEXT as TEXT FROM SYSIBMADM.TOP_DYNAMIC_SQL WHERE upper(STMT_TEXT) like 'SELECT%' ORDER BY NUM_EXECUTIONS 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)