Optimize simple count queries so that they can execute more quickly.
Merge branch 'master' of https://github.com/NextCenturyCorporation/neon