Don't materialize the TableView for a query just to get the count

Hurts performance a little when getting the count and then reading items (or getting the count a whole bunch of times), but significantly improves performance when the TableView is never needed.

Doing the same thing for the aggregate functions doesn't appear to have similar benefits at the moment.