Hi,

I'm using the code below from Nicks' blog (http://blog.notdot.net/
2010/01/ReferenceProperty-prefetching-in-App-Engine).

Everything works as expected locally, I can see one request in /_ah/
stats for getting 100 items. However when I run the same code on
Production, I can see this method getting called 100 times in /_ah/
stats and can see my database read allocation decrease very quickly.

Am I missing something with the setup, or is there a difference in
behaviour between local and production?

Thanks

Chris

def prefetch_refprops(entities, *props):
                fields = [(entity, prop) for entity in entities for prop in 
props]
                ref_keys = [prop.get_value_for_datastore(x) for x, prop in 
fields]
                ref_entities = dict((x.key(), x) for x in db.get(set(ref_keys)))
                for (entity, prop), ref_key in zip(fields, ref_keys):
                        prop.__set__(entity, ref_entities[ref_key])
                return entities

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to