The following examples collect distribution statistics for table space ACCTGTS:
//SYSIN DD *
NGTSTATS TABLESPACE PAYRGDB.ACCTGTS COLUMN(ALL)
KEYCARD FREQVAL NUMCOLS 1 COUNT 15 MOST
In this example, BMC AMI Stats collects column cardinality statistics for all indexed columns for each index. Additionally, it collects column group distribution statistics for each index on one column only, the first key column. It collects the15 most frequent values.
//SYSIN DD *
NGTSTATS TABLESPACE PAYRGDB.ACCTGTS COLUMN(ALL)
KEYCARD FREQVAL NUMCOLS 2 COUNT 3 BOTH
For each index, the first statement collects column statistics for all indexed columns. The second statement collects the specified frequency statistics for each index. The specification is to collect distribution statistics from two concatenated columns for three values, and to include both the most and least values.
In both examples, the table space page file is not read.
Use the TBCOLFREQ keyword to collect frequency distribution data on each column in the table space.
//SYSIN DD *
NGTSTATS TABLESPACE PAYRGDB.ACCTGTS COLUMN(ALL)
KEYCARD FREQVAL NUMCOLS 1 COUNT 15 MOST
TBCOLFREQ(YES)
In this example, the 15 most frequent values will be collected for each first key column with data from the indexes page files, and the 15 most frequent values will be collected for all other columns in the table space with data from the table space page file.
TBCOLFREQ(YES) implies READTS(YES):
- The table space page file is processed
- TBCOLFREQ controls collection of frequency statistics for non-indexed columns
- TBCOLFREQ consumes a high number of resources.
- For each column, distribution statistics are written to SYSIBM.SYSCOLDIST and SYSIBM.SYSCOLDISTSTATS