For most queries, an "IN" query is translated to multiple queries underneath the hood (#4 http://googleappengine.blogspot.com/2009/06/10-things-you-probably-didnt-know-about.html ).
You might be better off doing a keys only query for category=foo, filtering for the Keys in your application, then just doing a batch get. On Thu, May 27, 2010 at 4:18 PM, keyurva <[email protected]> wrote: > I'm using the low-level datastore api and I want to query by the key > property and another property (let's call it category). So the query > filter would be: __key__ IN [k1, k2, ..., kn] and category=foo > > I need to query based on a list of keys for which I'll use the IN > operator. I know that the max. number of values you can provide for > the IN clause is 30. > > I have 2 questions: > > 1. Does the limit of 30 IN values apply to the key property as well? > 2. Do I need to create a composite index on {__key__ + category} or > just on {category} for this query? > > Thanks, > Keyur > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- Ikai Lan Developer Programs Engineer, Google App Engine Blog: http://googleappengine.blogspot.com Twitter: http://twitter.com/app_engine Reddit: http://www.reddit.com/r/appengine -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" 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-java?hl=en.
