Database now provides calculated count and sum.