> The reason I'm asking is, I want to do a random query. I want to
> select a random entity from an entity group. I thought if the key is
> distributed like this, then I could generate a random string like it
> myself, and simply query for the first result bigger than this. Is
> this viable?
>
Google App Engine aside, this is a not a good way to select a random
key if you want to pick a key uniformly at random. Suppose the keys
were integers from 1 to 100, and there were three entities with random
keys of, say, {12,88,97}. You would be more likely to select 88 by
your method, since it has a longer gap preceding it.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---