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 2014/12/04 16:40:12 UTC
[jira] [Commented] (OAK-2320) Wrong optimization for joins with
ISDESCENDANTNODE conditions
[ https://issues.apache.org/jira/browse/OAK-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14234278#comment-14234278 ]
Thomas Mueller commented on OAK-2320:
-------------------------------------
Patch (SVN is not available right now):
{noformat}
--- src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java (revision 1643074)
+++ src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java (working copy)
@@ -67,14 +67,8 @@
@Override
public void restrict(FilterImpl f) {
if (f.getSelector().equals(ancestorSelector)) {
- String d = descendantSelector.currentPath();
- if (d == null && f.isPreparing() && f.isPrepared(descendantSelector)) {
- // during the prepare phase, if the selector is already
- // prepared, then we would know the value
- f.restrictPath(KNOWN_PARENT_PATH, Filter.PathRestriction.PARENT);
- } else if (d != null) {
- f.restrictPath(PathUtils.getParentPath(d), Filter.PathRestriction.PARENT);
- }
+ // we ca not currently optimize this case,
+ // as we would need a path restriction of type "ALL_PARENTS".
}
if (f.getSelector().equals(descendantSelector)) {
String a = ancestorSelector.currentPath();
{noformat}
> Wrong optimization for joins with ISDESCENDANTNODE conditions
> -------------------------------------------------------------
>
> Key: OAK-2320
> URL: https://issues.apache.org/jira/browse/OAK-2320
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core, query
> Affects Versions: 1.0.8, 1.1.2
> Reporter: Thomas Mueller
> Assignee: Thomas Mueller
>
> Joins with ISDESCENDANTNODE condition are incorrectly optimized when the join is executed in the reverse order: instead of a path condition of the form "all parents", a path condition of the form "parent" is used. That means, the first selector only traverse the parent node, when the TraversingIndex is used, instead of all possible parent nodes. As of now, there is no path condition of the form "all parents".
> This affects both SQL-2 and XPath queries.
> It is a problem if the join is reversed due to lower potential cost, which is so far seldom, and it looks like only in combination with the TraversingIndex. There are some existing tests that only fail when the new cost estimation is used (OAK-1907). Still, it is theoretically possible that existing code is affected (even without OAK-1907).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)