Improve Count performance by using SCARD and ZCARD when possible.