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 "Aliaksei (Jira)" <ji...@apache.org> on 2021/05/04 15:43:00 UTC
[jira] [Created] (OAK-9423) JCR_SQL2 with ISCHILDNODE slow
performance on large Repository
Aliaksei created OAK-9423:
-----------------------------
Summary: JCR_SQL2 with ISCHILDNODE slow performance on large Repository
Key: OAK-9423
URL: https://issues.apache.org/jira/browse/OAK-9423
Project: Jackrabbit Oak
Issue Type: Bug
Components: core
Reporter: Aliaksei
Very simple query
{code:java}
select n.* from [nt:hierarchyNode] as n where ISCHILDNODE(n, '/myfolder');{code}
Executed up to 40 seconds on Repository with ~5000 files and ~7000 folders. When similar query on the same repo
{code:java}
select n.* from [nt:hierarchyNode] as n where ISDESCENDANTNODE(n, '/myfolder')
{code}
took only ~20ms.
According to logs it looks like query with ISCHILDNODE traversing all repository - not only "/myfolder" but all the rest folders.
I found myself that problem might be in
*org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy:PathIterator*
{code:java}
PathIterator(Filter filter, String indexName, String pathPrefix, boolean prependPathPrefix) {
this.filter = filter;
this.pathPrefix = pathPrefix;
this.indexName = indexName;
boolean shouldDescendDirectly = filter.getPathRestriction().equals(Filter.PathRestriction.ALL_CHILDREN);
{code}
I'm pretty sure that *shouldDescendDirectly* should be true also for .*DIRECT_CHILDREN*.
I even tested it in debug mode and changed value in runtime. Query executed correctly with acceptable speed.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)