large_aggregation - large aggregation configuration parameter
This parameter is used to control the data types returned by Db2® for aggregate functions, allowing for a smoother migration from one version of Db2 to another. The large_aggregation configuration parameter enables or disables the use of larger data types for COUNT, SUM and AVG aggregate functions.
- Configuration type
- Database
- Applies to
- Parameter
-
- Configurable (requires a database connection)
- Propagation class
-
- ConnectionNote: The change in aggregation behavior will take effect after a database is deactivated and then reactivated.
- Connection
- Default [Range]
-
- If on Db2 or
Db2 on Cloud:
- No [Yes; No]
- If on BigSQL, Db2 Warehouse SaaS or IAS:
- Yes [Yes; No]
- If on Db2 or
Db2 on Cloud:
Usage notes
Changing the value of the large_aggregation configuration parameter has the
effect of changing the data type returned by the COUNT, SUM, and AVG functions as outlined below.
Applications written to expect a specific data type returned from these functions should first be
modified to handle the new data type. A change in the value of the configuration parameter takes
effect once the Db2 instance is restarted.
- COUNT
- With the large_aggregation configuration parameter set to
NO
, the COUNT function returns a value of data type INTEGER. With the large_aggregation configuration parameter set toYES
, the COUNT function returns a value of data type DECIMAL (31,0). - SUM
- The SUM function returns the following data types based on the value of the large_aggregation configuration parameter.
- AVG
- The AVG function returns the following data types based on the value of the large_aggregation configuration parameter.