STATISTICS command with REDUCE subcommand

This section describes the STATISTICS command with the REDUCE subcommand.

Usage

Specify REDUCE to control the following:
  • The duration and alignment of statistics interval records. For a definition of the interval record, see Report Reference.
  • The volume of data to be presented in traces and reports and stored in file and save data sets.

Usage notes

  • REDUCE is invoked automatically when you use the REPORT or SAVE subcommand.
  • REDUCE can be used once in a STATISTICS command.

Syntax of the REDUCE subcommand

Read syntax diagramSkip visual syntax diagramREDUCEFROM/TO blockINTERVAL(0minutes)BOUNDARY(60minutes0)INCLUDE/EXCLUDE block

Subcommand options

The syntax diagram shows the options that are available with this subcommand. See Subcommand options for comprehensive descriptions of these options. The following list gives additional or specific descriptions of selected options, where appropriate.

FROM/TO
Limits the range of DB2® statistics records to process by date and time.
Combinations of FROM date and time and TO date and time can be specified.
Note: DB2 statistics records are included from the last with a timestamp less than the FROM date and time to the last with a timestamp less than the TO date and time. The FROM/TO dates and times specified in REDUCE affect the other functions.

The DB2 statistics records available to REDUCE are limited by the GLOBAL FROM/TO dates and times.

If you do not specify a date and time, FROM/TO defaults to the date and time specified in the GLOBAL command. If dates and times are not specified in the GLOBAL command, all DB2 statistics records are included in the reduction process.

You can specify a time adjustment for a DB2 location using the TIMEZONE option of the GLOBAL command. The time adjustment is applied to the DB2 statistics record timestamp before FROM/TO processing.

Refer to GLOBAL command for more information.

For details on how to use the FROM/TO option, see FROM/TO subcommand options.

INTERVAL
Defines the duration of statistics interval records. The range is from 0 to 99 999 and is specified in minutes. When the DB2 statistics data is distributed to the interval records, they can be presented in Statistics reports and stored in a save data set.

For example, if INTERVAL(15) is specified, 15-minute intervals are created over the period that the DB2 statistics data is available for and the DB2 data is distributed to these intervals.

INTERVAL(0) specifies that only one interval record is created, starting with the first and ending with the last DB2 Statistics record pair.

If no interval is specified, the interval specified in the GLOBAL command is used. If no interval is specified in GLOBAL, the default is 0.

INTERVAL has an impact on performance. Always use the largest interval that meets your reporting requirements. If interval processing is not required, the default INTERVAL (0) is recommended for optimum performance. For more information about intervals, see Processing intervals.

The following example uses INTERVAL to specify an interval of two hours:
⋮
INTERVAL (120)
⋮
BOUNDARY
Controls the alignment of the statistic interval records defined by the INTERVAL option.

For more information on boundaries, see Processing intervals.

INCLUDE/EXCLUDE
Includes or excludes data associated with specific OMEGAMON® for DB2 PE identifiers.

For details, see INCLUDE and EXCLUDE subcommand options, which lists other identifiers allowed with this command and subcommand combination, and OMEGAMON for Db2 PE identifiers.

Processing intervals

The start time of the first interval processed by REDUCE is influenced by BOUNDARY, INTERVAL, and FROM.

OMEGAMON for DB2 PE attempts to reduce all data that falls between FROM and TO dates and times. The first interval processed starts at a time aligned with BOUNDARY, at or before the FROM time. If an interval cannot be aligned with the FROM time, the first properly aligned interval starting before the FROM time is used.

Although there is no restriction on the INTERVAL and BOUNDARY combination, your specification should comply with the following recommendations:
  • For intervals of less than 60 (excluding 0), there should be a whole number of intervals in an hour. Choose one of the following values:
    • 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, or 30.
  • For intervals of 60 or greater, there should be a whole number of intervals in a day. Choose one of the following values:
    • 60, 120, 180, 240, 360, 480, 720, or 1 440.
  • For intervals of one day (1440) or greater, INTERVAL should be a multiple of 1 440.
  • Select your interval and boundary so that the first interval starts at the FROM time.

The first interval record starts at a time aligned with BOUNDARY, at or before the FROM time. If an interval record cannot start at the FROM time, it starts before, at the nearest time that satisfies the BOUNDARY specification. Note that an interval record starting before the FROM time only contains data between the FROM time and the end of the interval record. Input data before the FROM time is not processed. An interval record ending after the TO time only contains data between the beginning of the interval record and the TO time. Input data after the TO time is not processed.

Example using REDUCE with FROM, TO, INTERVAL, BOUNDARY, and INCLUDE options

BOUNDARY(60) aligns the start time of interval records at the start of an hour, so the first interval record starts at the FROM time (08:00). Subsequent interval records start every 30 minutes (08:30, 09:00, and 09:30 each day). Only the DB2 statistics for location SYDNEY is processed.

⋮
REDUCE
   FROM     (,08:00)
   TO       (,10:00)
   INTERVAL (30)
   BOUNDARY (60)
   INCLUDE  (LOCATION(SYDNEY))
⋮

Example using REDUCE with options, together with SAVE

The following defaults are applied in this example:
  • For FROM, all dates and a time of 00:00:00.00.
  • For TO, all dates and a time of 23:59:59.99.

BOUNDARY(60) aligns the start time of interval records at the start of an hour, so the first interval record starts at the FROM time (00:00). Subsequent interval records cover 1 440 minutes or one day; an interval starts at 00:00 each day.

The interval records are saved in a data set for subsequent use.

⋮
REDUCE
   INTERVAL (1440)
   BOUNDARY (60)
SAVE
⋮

Example using REDUCE with options, together with REPORT with options

BOUNDARY(60) aligns the start time of interval records at the start of an hour, so the first interval record starts at the first properly aligned time before the FROM time, which is 08:00. Subsequent interval records start every two hours (10:00 and 12:00).

A report presenting the statistics data for each of the 2-hour periods is produced.

⋮
REDUCE
   FROM     (,08:15)
   TO       (,13:00)
   INTERVAL (120)
   BOUNDARY (60)
REPORT
   ORDER    (INTERVAL)
⋮