ESTIMATED-KEYS—Estimate the Number of Index Keys

The ESTIMATED-KEYS keyword estimates the number of index keys to recover.
cafrdb220
The ESTIMATED-KEYS keyword estimates the number of index keys to recover.
If you are recovering an index partition, use the number of rows in the partition as your estimate.
Including ESTIMATED-KEYS automatically invokes the dynamic allocation of the sort work data sets. If you omit ESTIMATED-KEYS from the job SYSIN and the PFR parmlib member, the following statements are checked in the displayed order in an attempt to populate the SORT:
  1. CARDF/CARD in SYSTABLEPART
  2. CARDF/CARD in SYSTABLES
  3. The product default of 30,000
Consider the following items when you use ESTIMATED-KEYS:
  • If your catalog statistics are out-of-date and you omit ESTIMATED-KEYS, the dynamically allocated sort work data sets might be the wrong size. If the data sets are too small, an abend can occur. If the data sets are too large, resources can be tied up unnecessarily.
  • ESTIMATED-KEYS is not valid with RECOVER DATABASE or RECOVER TABLESPACE.
  • Coding ESTIMATED-KEYS in the PFR parmlib member with a value of NONE or 0 is equivalent to not coding it at all.
  • You can specify SORTKEYS instead of ESTIMATED-KEYS.
  • When you use SHRLEVEL CHANGE with REBUILD INDEX, the ESTIMATED-KEYS keyword is passed to
    Rapid Reorg
    as ESTIMATED-ROWS for execution during the rebuild. For more information, see ESTIMATED-ROWS.
This keyword has the following format:
ESTIMATED-KEYS
int
or SORTKEYS
int
  • int
    Estimates the number of index keys to recover. To calculate this number, use the following method:
    1. For each table on which indexes are recovered, multiply the number of table rows by the number of table indexes.
    2. Add the products for each table.
    Specifying 0 is equivalent to omitting ESTIMATED-KEYS from the job SYSIN and the PFR parmlib member. The Db2 catalog statistics are checked in the order that was noted previously.
    Limits:
    2,147,000,000