MAX_QUERY_PARALLELISM option

Function

Sets upper bound for parallel execution of GROUP BY operations and for arms of a UNION.

Allowed values

Integer less than or equal to number of CPUs.

Default

24

Scope

Can be set temporary, for an individual connection, or for the PUBLIC group. Takes effect immediately.

Description

Sets an upper bound for parallelism the query optimizer can choose for GROUP BY operations or arms of a UNION, regardless of how many CPUs are available. This option is effective only on GROUP BY operations when PARALLEL_GBH_UNITS is not set. The PARALLEL_GBH_UNITS option sets a specific number for the degree of parallelism, whereas the MAX_QUERY_PARALLELISM option value is an upper limit and allows the optimizer more flexibility.

Normally, you should not set this option. However, if you have more than 16 CPUs and you see excessive CPU time spent on system usage, try setting MAX_QUERY_PARALLELISM to a value less than 16. Experiment with this value to determine the right setting for your platform, number of CPUs, and queries. There is some overhead involved when you distribute execution across multiple CPUs. In some configurations, this overhead may actually decrease performance if parallelism is allowed across all available CPUs, while in others, using all available CPUs may be beneficial.

See also

“PARALLEL_GBH_UNITS option”.