How fast are App Engine db.get(keys) and A.all(keys_only=True).filter('b =', b).fetch(1000)?
- by Liron Shapira
A db.get() of 50 keys seems to take me 5-6 seconds. Is that normal? What is the time a function of?
I also did a A.all(keys_only=True).filter('b =', b).fetch(1000) where A.b is a ReferenceProperty. I did 50 such round trips to the datastore, with different values of b, and the total time was only 3-4 seconds.
How is this possible? db.get() is done in parallel, with only one trip to the datastore, and I would think that looking up an entity by key is a faster operation than fetch.