Aggregation query optimization

2 posts were split to a new topic: I want to find the sum of Primary Type in every Year in descending order