jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Parvulescu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-2933) SQL2 Left Outer Join
Date Fri, 01 Apr 2011 16:41:05 GMT

    [ https://issues.apache.org/jira/browse/JCR-2933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014727#comment-13014727
] 

Alex Parvulescu commented on JCR-2933:
--------------------------------------

Hi Manfred, 
you are really devoted to this issue, thank you for putting in the time.

Here, I think you might have hit a nice usecase for JCR-2852. A join with an OR condition
didn't use to work 3 weeks ago, I guess you could say is it still undergoing bugfixes and
tests ;)
I'll look at this some more, see what I can come up with.

In the mean time, I think you'll find that this query works:
select * from [test:SamplePage] as page left outer join [test:SampleContent] as content on
ISDESCENDANTNODE(content,page) where (page.prop1 = 'page1' or page.prop1='page2') and content.prop1='content3'

As you are referencing both sides of the join on both OR conditions, this will never give
you the performance you are apparently seeking.

Talking about performance, there are other pending issues that deal with certain aspects of
SQL2 that are not up to speed. And as this is a tricky issue to tackle at best, please refrain
yourself from saying things like 
...
Have you ever tested with more as 3 nodes? 
if the left side have many rows, the performance is very poor. 
...
this does not help anybody, especially when you are putting a thing like performance on the
table.

Performance does not come OOTB, and if you eve have questions or need help with anything,
just ask on the list, there are plenty of people willing to help.


> SQL2 Left Outer Join
> --------------------
>
>                 Key: JCR-2933
>                 URL: https://issues.apache.org/jira/browse/JCR-2933
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.2.4
>            Reporter: Manfred Sattler
>            Assignee: Jukka Zitting
>         Attachments: JCR-2933-v2.patch, JCR-2933-v3.patch, JCR-2933.patch
>
>
> Create this nodes.
> def n1 = root.addNode("node1", "sling:SamplePage");
> n1.setProperty("n1prop1", "page1");
> def n2 = n1.addNode("node2", "sling:SampleContent");
> n2.setProperty("n2prop1", "content1");
> Execute this Query:
> Select * from [sling:SamplePage] as page left outer join [sling:SampleContent] as content
on ISDESCENDANTNODE(content,page) where page.n1prop1 = 'page1' and content.n2prop1 = 'content1';
> The resultset have 1 row with 2 Nodes. This OK.
> Then execute this:
> Select * from [sling:SamplePage] as page left outer join [sling:SampleContent] as content
on ISDESCENDANTNODE(content,page) where page.n1prop1 = 'page1' and content.n2prop1 = 'XXXXX';
> The resultset has 1 row with 1 node.
> This wrong. The result should be 0 rows.
> Old Versions, prior 2.2.2 have also 0 rows as result.
> Also, if nodes "n2" not exists, jackrabbit reports 1 row as result.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message