Sort file size estimation
The sort file size for each sort required is the major factor that affects the distribution of workloads and resources between separate sorts.
In almost all cases BMC AMI Recover can automatically estimate the file size using Db2 statistics, data set size, image copy size, or Db2 log ranges.
If the file size estimates that result from the use of the defaults are inaccurate and cause performance to suffer, BMC AMI Recover offers ways to override these estimates with the NUMREC option.
Log sort default
BMC AMI Recover attempts to estimate a file size for a log sort by calculating the number of pages contained in the SYSIBM.SYSLGRNX log range that is required to recover the all the objects in a step and assuming there will be one log record per page input to the sort.
Depending on the number of objects in the recovery, the size of log records, and the number of records for other objects, this strategy may or may not be reasonable. The values that are reported by the LOGSCAN command provide a better estimate for NUMREC and AVGRECSZ.
For more information about sorting the log, see LOGSORT-strategy.
Key sort default
BMC AMI Recover can determine index sort work space estimates based on RUNSTATS or real-time statistics.
Use of RUNSTATS
For index rebuilds, if the DB2 UT SORT DATA SET ALLOCATION field (UTSORTAL subsystem parameter) is set to NO, BMC AMI Recover uses the value that is stored by RUNSTATS in the CARD column of SYSIBM.SYSTABLES to determine the cardinality of the table. If the index is for a partitioned table space, the number of rows is divided equally among all partitions. If a -1 is in the CARD column, BMC AMI Recover (by default) assumes that RUNSTATS has not been run and calculates an estimated file size. This calculation is based on the size of the table space, the maximum rows per page, and the number of indexes.
Use of real-time statistics
For index rebuilds with the DSN6SPRM UTSORTAL parameter set to YES, BMC AMI Recover uses real-time statistics by using the TOTALROWS value from table SYSIBM.SYSTABLESPACESTATS for single-table table spaces.
Separate index rebuilds
When rebuilding multiple indexes of varying lengths on the same table space and not enough sorts are allowed to distribute the indexes with different length to separate sorts, sort performance is improved if some indexes are rebuilt in separate jobs because BMC AMI Recover pads all keys to the length of the longest key directed to the same sort to avoid a variable length record sort. Rebuilding some indexes in separate jobs also reduces the amount of sort work space that is required.
Related topic