I'm not sure the ID's are guranteed continous nor do they start at some starting point (0 or 1).
Assigning my own id's seems to turn into a more difficult problem of creating an IdGenerator. - Aleem On Fri, Jul 10, 2009 at 3:32 PM, Julian Namaro <namarojul...@gmail.com>wrote: > > You should try to generate a list of N random keys for your entity > because you can fetch that with only one datastore call(and no index). > Aren't google-generated numeric IDs guaranted continuous? > If not you can yourself assign alphanumeric keys that are continuous > (or generated by a formula that you pass on to the random generator). > > Julian > > > On Jul 10, 1:33 am, aloo <aleem.maw...@gmail.com> wrote: > > Hi all, > > > > I'm trying to write a GQL query that returns N random records of a > > specific kind. My current implementation works but requires N calls to > > the datastore. I'd like to make it 1 call to the datastore if > > possible. > > > > I currently assign a random number to every kind that I put into the > > datastore. When I query for a random record I generate another random > > number and query for records > rand ORDER BY asc LIMIT 1. > > > > This works, however, it only returns 1 record so I need to do N > > queries. Any ideas on how to make this one query? 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 google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---