I basically have the classic many to many model. A user, an award, and a "many-to-many" table mapping between users and awards.
Each user has on the order of 400 awards and each award is given to about 1/2 the users.
I want to iterate over all of the user's awards and sum up their points. In SQL it would be a table join between the many-to-many and then walk through each of the rows. On a decent machine with a MySQL instance, 400 rows should not be a big deal at all.
On app engine I'm seeing around 10 seconds to do the sum. Most of the time being spent in Google's datastore. Here is the first few rows of cProfile
ncalls tottime percall cumtime percall filename:lineno(function) 462 6.291 0.014 6.868 0.015 {google3.apphosting.runtime._apphosting_runtime___python__apiproxy.Wait} 913 0.148 0.000 1.437 0.002 datastore.py:524(_FromPb) 8212 0.130 0.000 0.502 0.000 datastore_types.py:1345(FromPropertyPb) 462 0.120 0.000 0.458 0.001 {google3.net.proto._net_proto___parse__python.MergeFromString}
Is my data model wrong? Am I doing the lookups wrong? Is this a shortcoming that I have to deal with with caching and bulkupdating (which would be a royal pain in the ass).