Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9423

JCR_SQL2 with ISCHILDNODE slow performance on large Repository

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • core
    • None

    Description

      Very simple query 

       

      select n.* from [nt:hierarchyNode] as n where ISCHILDNODE(n, '/myfolder');

      Executed up to 40 seconds on Repository with ~5000 files and ~7000 folders. When similar query on the same repo

       

       

      select n.* from [nt:hierarchyNode] as n where ISDESCENDANTNODE(n, '/myfolder')
      

      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

       

      
      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);
      

       

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Dubrou Aliaksei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: