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

Index cost is sometimes negative (index type "property")

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.9, 1.1.3
    • core, query
    • None

    Description

      The property index can return a negative cost in the following case:

      • It is a non-unique index (the default)
      • The "entryCount" is set to lower than 10000
      • The "keyCount" property is not set, or set to 0
      • The index matches

      In this case, the following formula is used and returns a negative value:

      (long) ((double) count / keyCount) + size;
      

      Count is for example 500, keyCount is 0. The division evaluates to infinity, which is converted to Long.MAX_VALUE. Size is larger than 0, so there is an overflow to negative.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: