Aggregation based on hashing