Author: thomasm Date: Thu Sep 13 12:21:33 2012 New Revision: 1384300 URL: http://svn.apache.org/viewvc?rev=1384300&view=rev Log: OAK-34 Define query API (javadocs) Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java?rev=1384300&r1=1384299&r2=1384300&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java Thu Sep 13 12:21:33 2012 @@ -23,6 +23,21 @@ import org.apache.jackrabbit.oak.spi.sta /** * Represents an index. The index should use the data in the filter if possible * to speed up reading. + *
+ * The query engine will pick the index that returns the lowest cost for the + * given filter conditions. + *
+ * The index should only use that part of the filter that speeds up data lookup. + * All other filter conditions should be ignored and not evaluated within this + * index, because the query engine will in any case evaluate the condition (and + * join condition), so that evaluating the conditions within the index would + * actually slow down processing. For example, an index on the property + * "lastName" should not try to evaluate any other restrictions than those on + * the property "lastName", even if the query contains other restrictions. For + * the query "where lastName = 'x' and firstName = 'y'", the query engine will + * set two filter conditions, one for "lastName" and another for "firstName". + * The index on "lastName" should not evaluate the condition on "firstName", + * even thought it will be set in the filter. */ public interface QueryIndex {