The total number of times that a set of data was sorted in order to process the stmt_operation.
Snapshot Level | Logical Data Grouping | Monitor Switch |
---|---|---|
Application | appl | Statement |
Application | stmt | Statement |
Dynamic SQL | dynsql | Statement |
This count includes sorts of temporary tables that were generated internally by the database manager to execute the statement. The number of sorts is associated with the first FETCH operation of the SQL statement. This information is returned to you when the operation for the statement is the first FETCH. You should note that for blocked cursors several fetches may be performed when the cursor is opened. In these cases it can be difficult to use the snapshot monitor to obtain the number of sorts, since a snapshot would need to be taken while DB2® was internally issuing the first FETCH.
A more reliable way to determine the number of sorts performed when using a blocked cursor would be with an event monitor declared for statements. The total_sorts counter, in the statement event for the CLOSE cursor, contains the total number of sorts that were performed while executing the statement for which the cursor was defined.