Thanks guys. Also thanks for the link! That was a really good reading. Looks like I need to change datamodel to avoid inequality filters. Unfortunately that will generate even more data, but I do not see any other workaround to implement the requirement.
BTW, what is more efficient for searching with multiple equality filters on same property? - entity with multivalue property having 50 values in it or - lots of small entities with single value property (e.g. above 50 values property exploded to 50 small entities) On Nov 14, 8:41 pm, Stephen Johnson <[email protected]> wrote: > 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=z... > > 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%2Bunsubscrib > > [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.
