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

With FastQuerySize, getSize() returns -1 if there are exactly 21 rows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.8.0
    • None
    • query
    • None

    Description

      If FastQuerySize is enabled, and the query result has exactly 21 rows, then getSize() returns -1. With 20 or 22 rows, the correct value is returned.

      Comment:
      One can not assume getSize() always returns a value larger than 0. Sometimes, getSize() returns too many, it could also return too few; it is just an estimate. The loop used to read the rows should only have "it.hasNext() && i < maxCount" as a condition. With maxCount for example 30. If the number of rows read is smaller than 30, then that's the real row count. If it's 30, then you can use getSize() as an estimation. That can still be -1 for "unknown", even with FastQuerySize enabled.

      But it's true that -1 is unexpected in this case.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thomasm Thomas Mueller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: