On Fri, Aug 19, 2011 at 1:38 AM, Stephen <[email protected]> wrote:

>
>
> On Thu, Aug 18, 2011 at 10:58 PM, thstart <[email protected]> wrote:
>
>>
>> I think Master/Slave is a lot faster in my case up to 10 times faster. I
>> tested it with only read, no write operations,
>> no transactions, nothing special for example I have a heavy use of this
>> expression:
>>
>>             e = MyList.get_profile(email)
>>                 my_keys = e.my_keys
>>                 my_members = db.get(my_keys)
>>
>>                 for member in my_members:
>>                         member.<property>, etc. <-- do something with the
>> property
>>
>
> Try this:
>
>             e = MyList.get_profile(email)
>                  my_keys = e.my_keys
>                 my_members = db.get(my_keys, config=db.create_config(
> read_policy=db.EVENTUAL_CONSISTENCY))
>

If you don't want to give you eventual consistency, try this:

my_members = db.get(my_keys,
             config=db.create_config(max_entity_groups_per_rpc=1))


Similarly, in Java you can set max entity groups per RPC:
- Set  the appengine.datastore.defaultMaxEntityGroupsPerRpc system property
to 1
- Use
http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreServiceConfig.html#maxEntityGroupsPerRpc(int)




>
>                 for member in my_members:
>                         member.<property>, etc. <-- do something with the
> property
>
>
> It's a relatively new option:
>
>
> http://code.google.com/intl/en/appengine/docs/python/datastore/functions.html#create_config
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>



-- 
Fred Sauer
Developer Advocate
Google Inc.
1600 Amphitheatre Parkway
Mountain View, CA 94043
[email protected]

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

Reply via email to