DB2 Version 9.7 for Linux, UNIX, and Windows

total_sort_time - Total sort time monitor element

The total elapsed time for all sorts that have been executed. This value is reported in milliseconds.

Table 1. Snapshot Monitoring Information
Snapshot Level Logical Data Grouping Monitor Switch
Database dbase Sort
Application appl Sort
Application stmt Sort
Dynamic SQL dynsql Sort
For snapshot monitoring, this counter can be reset.
Table 2. Event Monitoring Information
Event Type Logical Data Grouping Monitor Switch
Database event_db -
Connection event_conn -
Statements event_stmt -
Activities event_activity Statement, Sort

Usage

At a database or application level, use this element with total_sorts to calculate the average sort time, which can indicate whether or not sorting is an issue as far as performance is concerned.

At a statement level, use this element to identify statements that spend a lot of time sorting. These statements may benefit from additional tuning to reduce the sort time.

This count also includes sort time of temporary tables created during related operations. It provides information for one statement, one application, or all applications accessing one database.

When using monitor elements providing elapsed times, you should consider:
  1. Elapsed times are affected by system load, so the more processes you have running, the higher this elapsed time value.
  2. To calculate this monitor element at a database level, the database system monitor sums the application-level times. This can result in double counting elapsed times at a database level, since more than one application process can be running at the same time.
    To provide meaningful data from the database level, you should normalize the data to a lower level. For example:
     
     total_sort_time / total_sorts

    provides information about the average elapsed time for each sort.