Thomas Mueller created OAK-7254:

             Summary: Indexes with excludedPaths, or includedPaths should not 
be picked for queries without path
                 Key: OAK-7254
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: lucene, query
            Reporter: Thomas Mueller
             Fix For: 1.10

Queries that don't have a clear path restriction should not use indexes that 
have excludedPaths or includedPaths set, except in some exceptional cases (to 
be defined).

For example, if a query doesn't have a path restriction, say:

/jcr:root//element(*, nt:base)[@status='RUNNING']

Then an index that has excludedPaths set (for example to /etc) shouldn't be 
used, at least not if a different index is available. Currently it is used 
currently, actually in _favor_ of another index, if the property "status" is 
commonly used in /etc. Because of that, the index that doesn't have 
excludedPath has a higher cost (as it indexes the property "status" in /etc, 
and so has more entries for "status", than the index that doesn't index /etc).

The same for includedPaths, in case queryPaths isn't set to the same value(s).

This message was sent by Atlassian JIRA

Reply via email to