[google-appengine] Re: Question on increasing performance..

2009-08-25 Thread Devel63
Makes sense, but in this case I may need to "wrap" past the end of the collection, so I need to know how many entities satisfied the request before the end of the collection, so I know how many to skip over from the beginning. So, I still have the original question... On Aug 25, 5:32 am, "Nick J

[google-appengine] Re: Question on increasing performance..

2009-08-25 Thread Nick Johnson (Google)
On Mon, Aug 24, 2009 at 6:28 PM, Devel63 wrote: > > 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? Neither - use fetch(1, offset=2). -Nick Johnson > > On Aug 23, 4:41 pm, djidjadji wrote:

[google-appengine] Re: Question on increasing performance..

2009-08-24 Thread djidjadji
If it is about response time I think the normal-fetch(3) is faster. Only one call to the datastore, objects are fetched and converted to python-objects in parallel. If you also want to optimize the CPU-ms it depends on the size of the objects. Writing a test is the only way to know for your type

[google-appengine] Re: Question on increasing performance..

2009-08-24 Thread Devel63
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 wrote: > Your query will probably fetch more then 25 Action objects. Fetching > all those Keys is fast. Fetching all the

[google-appengine] Re: Question on increasing performance..

2009-08-23 Thread djidjadji
Every "a.project" statement results in a db.get() operation. Try to batch get() the project_key cache misses, and then set_multi() these in memcache. Put/Copy the project.active and project.deleted booleans in the Action object. Then you can use them in the query and just fetch 25 Action objects

[google-appengine] Re: Question on increasing performance..

2009-08-23 Thread djidjadji
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 wil