[ https://issues.apache.org/jira/browse/OAK-5980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Mueller updated OAK-5980: -------------------------------- Fix Version/s: (was: 1.8) 1.9 > 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.9 > > > 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.4.14#64029)