If you only want the 3rd object, do you think it's faster -- Just do a normal fetch(3) -- Do a keys_only fetch(3), then a get of the 3rd key?
On Aug 23, 4:41 pm, djidjadji <[email protected]> wrote: > Your query will probably fetch more then 25 Action objects. Fetching > all those Keys is fast. Fetching all the complete objects is slow, you > fetch a lot more then you need. > > If you iterate over the GQL query, no fetch, that requests full Action > objects (SELECT * FROM ACTION.......), the objects will be fetched in > batches of 20. You then only fetch a few more objects then needed. > > Performing XX_multi operations on the memcache will also help reduce > the response time. > > 2009/8/23 bvelasquez <[email protected]>: > > > > >http://pastie.org/592489 > > > If you can help me answer this question, I would appreciate it. > > > The above code takes the following ~ time: 1370ms 1725cpu_ms > > 670api_cpu_ms. > > > Changing the query to return the Actions bumps it up to : 2311ms > > 3050cpu_ms 1018api_cpu_ms > > > Changing the Action.get() to use the list of Keys from the SELECT > > takes ~ 2000cpu_ms. > > > I was surprised that doing an individual get on each key was faster > > than passing the array into get or returning the actions with the > > query. > > > What are your suggestions for optimizing this, if anything is > > obviously wrong or maybe there is another way completely for achieving > > the same results, which my limited experience is not telling me. > > > A couple notes. Project is a ReferenceProperty in Action. I'm > > getting the key and pulling that from memcache if it is available. > > > I'm breaking on count >= 25 because I only want 25 results where the > > Actions project is active and not deleted. I cannot limit the fetch > > on 25 because those 25 might be in an inactive Project. > > > Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
