On Jan 12, 2:12 am, wsstefan <[email protected]> wrote:
> I wrote a cronjob that goes through and recalculates my members' ranks
> 10 at a time using the the following request:
>
> profiles = Profile.all().order('-score').fetch(10,offset)
>
> for profile in profiles:
>   # calculate rank
>
> but once I get to anoffsetof more than4000I get this:
>
> BadRequestError:offsetmaynotbeabove4000
>
> Google Team:  Why is this limit applied?  Otherwise I have to
> construct a seemingly less efficient query like this:
>
> mod_rank = int(offset% interval)
> profiles = Profile.all().filter('score <', rank_score).order('-
> score').fetch(10, mod_rank)
> ifoffset% interval == 0:
>   memcache.set('rank_score', profile.score)


look 
http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html
"Queries on Keys"
"Unlike offset, this works efficiently for any number of entities. "

--~--~---------~--~----~------------~-------~--~----~
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