Adjust TopN queries to not do multiple passes when there is only one aggregator