The merge-join can only handle equality and not inequality except in the case where the inequality is used with the keys. So that is why this query would need an index and the ones without wouldn't need it. Also, if you read up on merge join if it fails to return the query results in a timely manner it will result in needing an index so I assume sometimes it could work and sometimes fail. I've heard they might have made it a little less strict in this aspect but not certain. You may want to check out this book by Dan Sanderson. The link below should take yo to the section on merge join. He's got a really good explanation of it.
http://books.google.com/books?id=6cL_kCZ4NJ4C&pg=PA149&lpg=PA149&dq=zig+zag+merge+join+app+engine&source=bl&ots=sIjjSWTZho&sig=6fk5dn-Ys7SCasWEh0_3dd2auww&hl=en&ei=cSzgTPySIYjUtQOG8o3rCg&sa=X&oi=book_result&ct=result&resnum=7&ved=0CD4Q6AEwBjgK#v=onepage&q&f=false On Sun, Nov 14, 2010 at 9:26 AM, anatoliy <[email protected]>wrote: > Here is more info: error appears only in case I mix equality & > inequality operator on same property. For example: > > SELECT * FROM IndexRecord WHERE nss = 'don' AND nss >= '_do' AND nss < > '_dp' > > gives the exception. > > Strange, though, that via admin console this query does not show any > error. But resultset is empty even though it should bring results! > > On Nov 13, 11:48 am, anatoliy <[email protected]> wrote: > > I have an entity with indexed property "nss" which is a collection. > > > > Making query like (produced via Query.toString()): > > > > SELECT __key__ FROM IndexRecord WHERE nss = qwe AND nss = wer AND nss > > = ert AND nss = rty AND nss = tyu > > > > causes randomly (e.g. it works occasionally) exceptions "no matching > > index found.." with indexes: > > <datastore-index kind="IndexRecord" ancestor="false" source="manual"> > > <property name="nss" direction="asc"/> > > <property name="nss" direction="asc"/> > > <property name="nss" direction="asc"/> > > </datastore-index> > > > > <datastore-index kind="IndexRecord" ancestor="false" source="manual"> > > <property name="nss" direction="asc"/> > > <property name="nss" direction="asc"/> > > <property name="nss" direction="asc"/> > > <property name="nss" direction="asc"/> > > </datastore-index> > > > > I expected that datastore is able to reuse same index for a property > > if multiple filters specified. SDK does not generate index > > declarations in the datastore-indexes-auto.xml file. > > > > Strange thing that running that query from console works ok: > > > > SELECT * FROM IndexRecord WHERE nss = 'qwe' AND nss = 'wer' AND nss = > > 'ert' AND nss = 'rty' AND nss = 'tyu' AND nss = 'tydu' > > -- > 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]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- 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.
