Class PushFilterThroughCountAggregation
This rule transforms plans with a FilterNode above an AggregationNode. The AggregationNode must be grouped and contain a single aggregation assignment with `count()` function and a mask.
If the filter predicate is `false` for the aggregation's result value `0`, then the aggregation's mask can removed from the aggregation, and applied as a filter below the AggregationNode. After such transformation, any group such that no rows of that group pass the filter, is removed by the pushed down FilterNode, and so it is not processed by the AggregationNode. Before the transformation, the group would be processed by the AggregationNode, and return `0`, which would then be filtered out by the root FilterNode.
After the mask pushdown, it is checked whether the root FilterNode is still needed, based on the fact that the aggregation never returns `0`.
Transforms:
- filter (count > 0 AND predicate)
- aggregation
group by a
count <- count() mask: m
- source (a, m)
into:
- filter (predicate)
- aggregation
group by a
count <- count()
- filter (m)
- source (a, m)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PushFilterThroughCountAggregation
-
-
Method Details
-
rules
-