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 2012/11/02 10:59:12 UTC

[jira] [Created] (OAK-419) Query: Conditions are not pushed to "outer join" selectors

Thomas Mueller created OAK-419:
----------------------------------

             Summary: Query: Conditions are not pushed to "outer join" selectors
                 Key: OAK-419
                 URL: https://issues.apache.org/jira/browse/OAK-419
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: core
            Reporter: Thomas Mueller
            Assignee: Thomas Mueller
            Priority: Minor


Currently the query plan for the following query

    select * from [nt:base] as c 
    right outer join [nt:base] as p on p.id = c.p 
    where p.id is not null 
    and isdescendantnode(p, '/testRoot') 
    and isdescendantnode(c, '/testRoot')

is:

    [nt:base] as [p] 
    /* traverse "/testRoot//*" 
    where (([p].[id] is not null) 
    and (isdescendantnode([p], [/testRoot]))) 
    and ([p].[id] is not null) */ 
    left outer join [nt:base] as [c] 
    /* traverse "//*" 
    where (isdescendantnode([c], [/testRoot])) 
    and ([c].[p] is not null) */ 
    on [p].[id] = [c].[p]

Because of that, far too many nodes are traversed on [c].
Instead, the isdescendantnode condition should be pused to [c] so that
it only traverses "/testRoot//*".

The result of the query is still correct, but performance is potentially very bad (even if there is an index).

--
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

[jira] [Updated] (OAK-419) Query: Conditions are not pushed to "outer join" selectors

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OAK-419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller updated OAK-419:
-------------------------------

    Description: 
Currently the query plan for the following query

{code}
select * from [nt:base] as c 
right outer join [nt:base] as p on p.id = c.p 
where p.id is not null 
and isdescendantnode(p, '/testRoot') 
and isdescendantnode(c, '/testRoot')
{code}

is:

{code}
[nt:base] as [p] 
/* traverse "/testRoot//*" 
where (([p].[id] is not null) 
and (isdescendantnode([p], [/testRoot]))) 
and ([p].[id] is not null) */ 
left outer join [nt:base] as [c] 
/* traverse "//*" 
where (isdescendantnode([c], [/testRoot])) 
and ([c].[p] is not null) */ 
on [p].[id] = [c].[p]
{code}

Because of that, far too many nodes are traversed on "c".
Instead, the isdescendantnode condition should be pused to "c" so that
it only traverses "/testRoot//*".

The result of the query is still correct, but performance is potentially very bad (even if there is an index).

  was:
Currently the query plan for the following query

    select * from [nt:base] as c 
    right outer join [nt:base] as p on p.id = c.p 
    where p.id is not null 
    and isdescendantnode(p, '/testRoot') 
    and isdescendantnode(c, '/testRoot')

is:

    [nt:base] as [p] 
    /* traverse "/testRoot//*" 
    where (([p].[id] is not null) 
    and (isdescendantnode([p], [/testRoot]))) 
    and ([p].[id] is not null) */ 
    left outer join [nt:base] as [c] 
    /* traverse "//*" 
    where (isdescendantnode([c], [/testRoot])) 
    and ([c].[p] is not null) */ 
    on [p].[id] = [c].[p]

Because of that, far too many nodes are traversed on [c].
Instead, the isdescendantnode condition should be pused to [c] so that
it only traverses "/testRoot//*".

The result of the query is still correct, but performance is potentially very bad (even if there is an index).

    
> Query: Conditions are not pushed to "outer join" selectors
> ----------------------------------------------------------
>
>                 Key: OAK-419
>                 URL: https://issues.apache.org/jira/browse/OAK-419
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>
> Currently the query plan for the following query
> {code}
> select * from [nt:base] as c 
> right outer join [nt:base] as p on p.id = c.p 
> where p.id is not null 
> and isdescendantnode(p, '/testRoot') 
> and isdescendantnode(c, '/testRoot')
> {code}
> is:
> {code}
> [nt:base] as [p] 
> /* traverse "/testRoot//*" 
> where (([p].[id] is not null) 
> and (isdescendantnode([p], [/testRoot]))) 
> and ([p].[id] is not null) */ 
> left outer join [nt:base] as [c] 
> /* traverse "//*" 
> where (isdescendantnode([c], [/testRoot])) 
> and ([c].[p] is not null) */ 
> on [p].[id] = [c].[p]
> {code}
> Because of that, far too many nodes are traversed on "c".
> Instead, the isdescendantnode condition should be pused to "c" so that
> it only traverses "/testRoot//*".
> The result of the query is still correct, but performance is potentially very bad (even if there is an index).

--
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

[jira] [Resolved] (OAK-419) Query: Conditions are not pushed to "outer join" selectors

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OAK-419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller resolved OAK-419.
--------------------------------

    Resolution: Fixed

Fixed in revision 1404926
                
> Query: Conditions are not pushed to "outer join" selectors
> ----------------------------------------------------------
>
>                 Key: OAK-419
>                 URL: https://issues.apache.org/jira/browse/OAK-419
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>
> Currently the query plan for the following query
> {code}
> select * from [nt:base] as c 
> right outer join [nt:base] as p on p.id = c.p 
> where p.id is not null 
> and isdescendantnode(p, '/testRoot') 
> and isdescendantnode(c, '/testRoot')
> {code}
> is:
> {code}
> [nt:base] as [p] 
> /* traverse "/testRoot//*" 
> where (([p].[id] is not null) 
> and (isdescendantnode([p], [/testRoot]))) 
> and ([p].[id] is not null) */ 
> left outer join [nt:base] as [c] 
> /* traverse "//*" 
> where (isdescendantnode([c], [/testRoot])) 
> and ([c].[p] is not null) */ 
> on [p].[id] = [c].[p]
> {code}
> Because of that, far too many nodes are traversed on "c".
> Instead, the isdescendantnode condition should be pused to "c" so that
> it only traverses "/testRoot//*".
> The result of the query is still correct, but performance is potentially very bad (even if there is an index).

--
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