Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3254

BitVector.isSparse is sometimes wrong

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.4, 4.0-ALPHA
    • core/other
    • None
    • New

    Description

      In working on LUCENE-3246, I found a few problems with
      BitVector.isSparse:

      • Its math can overflow int, such that if there are enough deleted
        docs and maxDoc() is largish, isSparse may incorrectly return true
      • It over-estimates the size of the sparse file, since when
        estimating number of bytes for the vInt dgaps it uses bits.length
        instead of bits.length divided by number of set bits (ie, the
        "average" gap between set bits)

      This is relatively harmless (just affects performance / size of .del
      file on disk, not correctness).

      Attachments

        1. LUCENE-3254.patch
          9 kB
          Michael McCandless

        Activity

          People

            mikemccand Michael McCandless
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: