Calculating space required for METRDATA
The METRDATA data set contains metrics about individual SQL calls at a summary level.
About this task
The level of reduction depends on the values specified in the CQMPARMS OPTKEYS parameters. Without the specification of OPTKEYS the reduction is done on the following input keys:
- Plan
- Program
- Cursor/section
- Statement#
- Statement type
For example, consider a program that contains a dynamic SQL sequence of calls:
100 PREPARE
105 OPEN
110 FETCH
120 CLOSE
130 COMMIT
If all the calls in the program are executed 200 times by 200 users, Query Monitor will only create 5 records in the METRDATA data set at interval expiration. However, if Query Monitor is started with OPTKEYS(AUTHIDS), and the same query is executed once by the same 200 users QM will create 1000 records at interval expiration. If the same query is executed twice by each user, Query Monitor will still create 1000 records.
The goal in determining a reasonable amount of space to specify for the primary allocation for the METRDATA data set is to first determine the average number of unique SQL calls that Query Monitor will record in the METRDATA data set at interval expiration.
The other optional keys that maybe specified are CORRID, WSUSER, WSNAME, WSTRAN, and TEXT, which correspond to the correlation id, workstation user, workstation name, workstation transaction and SQL text token respectively. The subparameters of the OPTKEYS startup parameter describe basic DB2 identifiers, but the TEXT sub-parameter describes a unique dynamic SQL statement.
To continue the example, if OPTKEYS(TEXT) is specified and the dynamic SQL program is executed one time, Query Monitor will record 5 records in the METRDATA data set. If the program is executed and prepares and executes 100 distinct SQL statements with the 5 call sequence, then the METRDATA data set will contain 500 records at interval expiration.
To determine the number of tracks needed: