DB2 10.5 for Linux, UNIX, and Windows

GRPBY operator

This operator represents the grouping of rows.

Operator name: GRPBY

Represents: The grouping of rows according to common values of designated columns or functions. This operation is required to produce a group of values, or to evaluate set functions.

If no GROUP BY columns are specified, the GRPBY operator can still be used if there are aggregation functions in the SELECT list, indicating that the entire table is treated as a single group when doing that aggregation.

Performance suggestions:
  • This operator represents a necessary operation. To improve access plan costs, concentrate on other operators (such as scans and joins) that define the set of rows to be grouped.
  • To improve the performance of a SELECT statement that contains a single aggregate function but no GROUP BY clause, try the following:
    • For a MIN(C) aggregate function, create an ascending index on C.
    • For a MAX(C) aggregate function, create a descending index on C.