GAE: The best way to determine the number of types is stored?

advertisements

What is the best way to determine how many models of a certain kind are in my app's datastore? The documentation says that MyKind.all().count() is only marginally better than retrieving all of the data, and has a limit of 1000. This is not helpful, because I am expecting to have 6000+ instances of MyKind stored.

Is there a better way to do this? What if I just get the keys, and count those?

I'm using Python.


If an approximate count is good enough, you could use the statistics API:

http://code.google.com/appengine/docs/python/datastore/stats.html