MAX_CUBE_RESULT option

Function

Sets the maximum number of rows that the IQ optimizer will consider for a GROUP BY CUBE operation.

Allowed values

0 to 250000000

Scope

Can be set by any user, at any level. This option takes effect immediately.

Default

10000000

Description

When generating a query plan, the IQ optimizer estimates the total number of groups generated by the GROUP BY CUBE hash operation. The IQ optimizer uses a hash algorithm for the GROUP BY CUBE operation. This option sets an upper boundary for the number of estimated rows the optimizer will consider for a hash algorithm that can be run. If the actual number of rows exceeds the MAX_CUBE_RESULT option value, the optimizer stops processing the query and returns the error message “Estimate number: nnn exceed the DEFAULT_MAX_CUBE_RESULT of GROUP BY CUBE or ROLLUP”, where nnn is the number estimated by the IQ optimizer.

Set MAX_CUBE_RESULT to zero to override the default value. When this option is set to zero, the IQ optimizer does not check the row limit and lets the query run. Setting MAX_CUBE_RESULT to zero is not recommended, as the query may not succeed.