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

QueryResult.getSize() can be slow for many "or" or "union" conditions

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.34.0
    • Component/s: query
    • Labels:
      None

      Description

      For queries with many union conditions, the "fast" getSize method can actually be slower than iterating over the result.

      The reason is, the number of index calls grows exponential with regards to number of subqueries: (3x + x^2) / 2, where x is the number of subqueries. For this to have a measurable affect, the number of subqueries needs to be large (more than 100), and the index needs to be slow.

        Attachments

          Activity

            People

            • Assignee:
              thomasm Thomas Mueller
              Reporter:
              thomasm Thomas Mueller
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: