Enabling eager aggregation

Eager aggregation is controlled by the advanced_aggregation optimizer setting, which is off by default in all optimization goals except allrows_dss, where it is on. Eager aggregation can be enabled, disabled, or reset to the optimizer goal’s default value at either the connection or query level.

For example, to enable at the connection level:

set advanced_aggregation on

To enable at the query level:

select r1, sum (s1)
from r, s
where r2 = s2
group by r1
plan 
"(use advanced_aggregation on)"

Alternatively, if the optimization goal is set to allrows_dss, eager aggregation is implicitly enabled. In this example, an abstract plan sets allrows_dss at the query level:

select r1, sum (s1)
from r, s
where r2 = s2
group by r1
plan
"(use optgoal allrows_dss)"