[google-appengine] Re: datastore .order question

2008-10-13 Thread David Wilson (entertainment cloud)
good news all round :) thanks for clearing that up everyone. On Oct 13, 7:05 pm, yejun <[EMAIL PROTECTED]> wrote: > It will only pull unnecessary data when you use offset parameter in > fetch(limit,offset=0). Because when you set an offset, the datastore > still need to iterate all previous dat

[google-appengine] Re: datastore .order question

2008-10-13 Thread yejun
It will only pull unnecessary data when you use offset parameter in fetch(limit,offset=0). Because when you set an offset, the datastore still need to iterate all previous data before that offset. On Oct 13, 1:25 pm, "David Wilson (entertainment cloud)" <[EMAIL PROTECTED]> wrote: > when you say t

[google-appengine] Re: datastore .order question

2008-10-13 Thread Marzia Niccolai
Sorry if it was unclear. This would only pull Thing 6. -Marzia On Mon, Oct 13, 2008 at 10:25 AM, David Wilson (entertainment cloud) < [EMAIL PROTECTED]> wrote: > > > when you say the same is not true of filter, are you saying that > > Thing.all().filter('value >' 5).get() > > will pull Things

[google-appengine] Re: datastore .order question

2008-10-13 Thread David Wilson (entertainment cloud)
when you say the same is not true of filter, are you saying that Thing.all().filter('value >' 5).get() will pull Things 1,2,3,4,5(like the offset issue) the records from the datastore, but just return Things 6 from the query. this seems wrong to me. The reason im making sure on this is that

[google-appengine] Re: datastore .order question

2008-10-13 Thread Marzia Niccolai
Hi, The same is not true of filter(). Filter will start at the first value larger than x, and should be used if you want to paginate your records. Brett Slatkin's IO talk covers scalable pagination recipes, and I suggest checking it out: http://sites.google.com/site/io/building-scalable-web-appl

[google-appengine] Re: datastore .order question

2008-10-13 Thread David Wilson (entertainment cloud)
ok, i wanted to be sure about this, as pulling all the records and just returning one would have been a performance disaster for my app. my question was raised because i was a little surprised to read that offset queries still pull all the 'upto' offset out of the store. does the same apply to T

[google-appengine] Re: datastore .order question

2008-10-13 Thread Sylvain
Only '1' http://code.google.com/appengine/docs/datastore/queryclass.html#Query_get On 13 oct, 13:41, "David Wilson (entertainment cloud)" <[EMAIL PROTECTED]> wrote: > Hi, > > class Thing(db.Model): > > value = db.IntegerProperty(required=True) > > datastore has 10 Things with value 1..10 >