Cached count query