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 2017/03/24 08:23:41 UTC
[jira] [Created] (OAK-5980) Bad Join Query Plan Used
Thomas Mueller created OAK-5980:
-----------------------------------
Summary: Bad Join Query Plan Used
Key: OAK-5980
URL: https://issues.apache.org/jira/browse/OAK-5980
Project: Jackrabbit Oak
Issue Type: Bug
Components: query
Reporter: Thomas Mueller
Assignee: Thomas Mueller
Fix For: 1.8
For a join query, where selectors are joined over ischildnode but also can use an index,
the selectors sometimes use the index instead of the much less
expensive parent join. Example:
{noformat}
select [a].* from [nt:unstructured] as [a]
inner join [nt:unstructured] as [b] on ischildnode([b], [a])
inner join [nt:unstructured] as [c] on ischildnode([c], [b])
inner join [nt:unstructured] as [d] on ischildnode([d], [c])
inner join [nt:unstructured] as [e] on ischildnode([e], [d])
where [a].[classname] = 'letter'
and isdescendantnode([a], '/content')
and [c].[classname] = 'chapter'
and localname([b]) = 'chapters'
and [e].[classname] = 'list'
and localname([d]) = 'lists'
and [e].[path] = cast('/content/abc' as path)
{noformat}
The order of selectors is sometimes wrong (not e, d, c, b, a), but
more importantly, selectors c and a use the index on className.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)