by rlmumford: Make count queries better.W