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 "Thomas Mueller (JIRA)" <ji...@apache.org> on 2013/01/23 13:38:12 UTC

[jira] [Resolved] (OAK-579) Query: for joins, sometimes no or the wrong index is used

     [ https://issues.apache.org/jira/browse/OAK-579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller resolved OAK-579.
--------------------------------

    Resolution: Fixed

Should be fixed in revision 1437366
                
> Query: for joins, sometimes no or the wrong index is used
> ---------------------------------------------------------
>
>                 Key: OAK-579
>                 URL: https://issues.apache.org/jira/browse/OAK-579
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: query
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>
> Currently, no index is used for the join condition. For example, the query:
> {code}
> select * from [nodeTypeA] as a 
> inner join [nodeTypeB] as b
> on isdescendantnode(b, a) 
> where lower(a.x) = 'y'
> and b.[property] is not null
> {code}
> currently doesn't take into account that the path of the selector 'a' is known at the time selector 'b' is accessed (given that selector 'a' is executed first). So in this case, the query would use an index on the property b.[property], even if this index has a very bad selectivity (many nodes with this problem), or the query would use the node type index on [nodeTypeB], even if there are many nodes of this type.
> Instead, most likely the query should do a traversal, using the isdescendantnode(b, a) join condition.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira