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

Configurable parameters for the test
Parameter Description

Test period

How often should the test be executed

Host

The IP address of the DB2 server

Port

  • The port number through which the DB2 server communicates. The default port is 50000.
  • User

    Specify the name of the user who is authorized to access the target database server and collect the required metrics in this text box. You can create a separate user on the OS hosting the DB2 server for this purpose. The steps for the same are detailed in the Creating a Special User for Monitoring DB2 Server topic.

    Password

    Enter the password of the specified USER in the PASSWORD text box.

    Confirm Password

    Confirm the Password by retyping it in the Confirm Password text box.

    Database

    Specify the name of the database on the monitored DB2 server to be used by this test.

    Include DB

    Specify a comma-separated list of databases that you wish to monitor in the Include DB text box.

    Exclude DB

    Specify a comma-separated list of databases that need to be excluded from monitoring in the Exclude DB text box.

    SSL

    If the target database server is SSL-enabled, then set the SSL flag to Yes. If not, then set the SSL flag to No.

    Trust Store File Name

    This parameter is applicable only if the target DB2 UDB database is SSL-enabled, if not, set this parameter to none. Specify the file name of the client-side SSL truststore that contains the server certificate required for establishing an SSL connection. The truststore is used to verify the identity of the server and enable a secure communication channel.

    By default, the truststore file should be placed in:<EG_INSTALL_DIR>/jre/lib/security/mytruststore.jks

    Here, mytruststore.jks is the Truststore file name. You may change this to any valid file name. By default, none is specified against this text box.

    Trust Store Password

    This parameter is applicable only if the target DB2 UDB database is SSL-enabled, if not, set this parameter to none. If a Truststore File name is provided, then, in this text box, provide the password that is used to obtain the associated certificate details from the Truststore File. By default, this parameter is set to none.

    Confirm Password

    Confirm the Password by retyping it in the Confirm Password text box.

    Measurements made by the test:
    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.