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.
Here is the definition for my class A:
class App(db.Model):
name_atom = db.ReferenceProperty(AppName)
author = db.ReferenceProperty(Author)
short_desc = db.StringProperty()
description = db.TextProperty()
url = db.StringProperty()
rating_avg = properties.RangeProperty(0, 1000, default=0)
rating_count = properties.RangeProperty(min_value=0, default=0)
add_dt = db.DateTimeProperty(auto_now_add=True)
modify_dt = db.DateTimeProperty(auto_now=True)
Update
OK, AppStats says: datastore_v3.Get real=2272ms api=416ms
I think what's happening is that I'm doing this db.get([50 keys]) right after a ton of other inefficient datastore calls in the same request handler, and it's just rate limiting me or something. Other times I've done the same db.get() and it returned in 200ms :)