You can resolve COUNT(DISTINCT) hotspot issues by using partial-final optimization.
- The COUNT(DISTINCT) function has been used but the performance requirement of an aggregate node is not met.
- The aggregate node where the COUNT(DISTINCT) function is executed does not have user-defined aggregate functions (UDAFs).
On the Parameters tab of the Development page, set blink.partialAgg.enabled to true.
After partial-final optimization is enabled, check whether an expand node is included in the topology or whether the aggregation process has two layers.