[
https://issues.apache.org/jira/browse/OAK-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14068269#comment-14068269
]
Thomas Mueller commented on OAK-1965:
-------------------------------------
I'm not happy with the proposed (and implemented) solution. Unfortunately I was
on vacation so I did not see this issue. The proposed solution requires a
special index (an index on both properties), and makes the index implementation
more complicated.
Please note "x = 1 or y = 2" is already very fast for XPath, because it is
converted to a "union". That means, the query is fast if there is an index on
"x" plus another index on "y". The missing piece is using "union" for SQL-2 as
well. OAK-1617 is about automatically converting to "union" for SQL-2. Once
this is implemented, the solution here will not be needed any longer.
> Support for constraints like: foo = 'X' OR bar = 'Y'
> ----------------------------------------------------
>
> Key: OAK-1965
> URL: https://issues.apache.org/jira/browse/OAK-1965
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core, query
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Fix For: 1.1
>
> Attachments: oak-core-1.0.3-OAK-1965-SNAPSHOT.jar
>
>
> Consider the following query statement:
> {noformat}
> SELECT * FROM [nt:base] WHERE [foo] = 'X OR [bar] = 'Y'
> {noformat}
> Such a query could be fairly efficiently executed against a property index
> that indexes the values of both "foo" and "bar" properties. However, the
> query engine doesn't pass such OR constraints down to the index
> implementations, so we currently can't leverage such an index for this query.
--
This message was sent by Atlassian JIRA
(v6.2#6252)