Adjusting aggregate query for taxonomy analysis