Db2 Sorts Test
Sorting represents organizing the rows in a table into the order of one or more of its columns, optionally eliminating duplicate entries. Sorting is required when:
- No index exists to satisfy a requested ordering (for example a SELECT statement that uses the ORDER BY clause).
- An index exists but sorting would be more efficient than using the index
- An index is created.
- An index is dropped, which causes index page numbers to be sorted.
Because queries often require sorted or grouped results, sorting is often required, and the proper configuration of the sort heap areas is crucial to good query performance. Using the Db2Sort test, administrators can figure out whether/not the sort heap allocations are sufficient to facilitate efficient sorting.
Target of the test : A DB2 database server
Agent deploying the test : An internal agent
Outputs of the test : One set of results for every database on the DB2 database server that is currently active
|
Measurement | Description | Measurement Unit | Interpretation |
---|---|---|---|
Sort Heap Allocated: |
Indicates the sum of sort heap space allocated for all sorts in all active databases in the database manager. |
Pages |
Normal memory estimates do not include sort heap space. If excessive sorting is occurring, the extra memory used for the sort heap should be added to the base memory requirements for running the database manager. Generally, the larger the sort heap, the more efficient the sort. Appropriate use of indexes can reduce the amount of sorting required. You may use the information returned at the database manager level to help you tune the SHEAPTHRES configuration parameter. If the element value is greater than or equal to SHEAPTHRES, it means that the sorts are not getting the full sort heap as defined by the SORTHEAP parameter. |
Average Sort Heap Space Used: |
Indicates the average sort heap space used by each sort. |
Pages |
If the SORTHEAP configuration parameter is substantially larger than the average sort heap used, you may be able to lower the value of this parameter. |
Sort Rate: |
Indicates the number of sort operations performed during the last measurement period. |
Sorts / Sec |
|
Sort overflow percentage |
Indicates the percentage of sorts that had to overflow to disk. |
Percent |
Sort overflows are sorts that ran out of sort heap and may have required disk space for temporary storage. When a sort overflows, additional overhead will be incurred because the sort will require a merge phase and can potentially require more I/O, if data needs to be written to disk. If this percentage is high, you may want to adjust the database configuration by increasing the value of sortheap. |
Average Sort Time: |
Indicates the average sort time for all sorts performed by all applications connected to a particular database. |
Secs |
A high value indicates the poor performance of sorting operations. Identify the statements that spend lot of time sorting. You may want to reduce the average sort time for these statements by increasing the sortheap parameter. |