I think that query.count() is faster than len(query.fetch()) since ndb doesn't have to return all of the results.