Achieve faster cardinality aggregations via dynamic pruning