You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Vikas Saurabh (JIRA)" <ji...@apache.org> on 2016/08/18 09:46:21 UTC
[jira] [Commented] (OAK-4681) Automatically convert *all* "or"
queries to "union" for SQL-2
[ https://issues.apache.org/jira/browse/OAK-4681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15426174#comment-15426174 ]
Vikas Saurabh commented on OAK-4681:
------------------------------------
Just to mention, breaking query into UNION would imply execution of 2 separate queries where the merge is done in QE. While that's probably completely ok if each of the sub-queries are answered by prop indices. But, a single lucene index could very well be handling both OR clauses and splitting into UNION might end up choosing entirely different index (prop or lucene).
Moreover, with OR clauses lucene automatically ranks more clause-matches above... this is usually a good ordering... splitting would remove that too.
> Automatically convert *all* "or" queries to "union" for SQL-2
> -------------------------------------------------------------
>
> Key: OAK-4681
> URL: https://issues.apache.org/jira/browse/OAK-4681
> Project: Jackrabbit Oak
> Issue Type: New Feature
> Components: query
> Reporter: Thomas Mueller
> Fix For: 1.6
>
>
> Currently, in OAK-1617, simple SQL-2 queries that contain "or" are converted to "union" if the cost is lower. However, more complex queries are not converted, see AndImpl.java, convertToUnion(), "in this case prefer to be conservative and don't optimize. This could happen when for example: WHERE (a OR b) AND (c OR d)."
> It is implemented for XPath, and works fine there, so I think it is reasonable to do that for SQL-2 as well for trunk.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)