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

FieldComparator.TermOrdValComparator compares by value unnecessarily

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.1, 4.0-ALPHA
    • core/search
    • None
    • New

    Description

      Digging on LUCENE-2504, I noticed that TermOrdValComparator's compareBottom method falls back on compare-by-value when it needn't.

      Specifically, if we know the current bottom ord "matches" the current segment, we can skip the value comparison when the ords are the same (ie, return 0) because the ords are exactly comparable.

      This is hurting string sort perf especially for optimized indices (and also unoptimized indices), and especially for highly redundant (not many unique values) fields. This affects all releases >= 2.9.x, but trunk is likely more severely affected since looking up a value is more costly.

      Attachments

        1. LUCENE-2504.patch
          3 kB
          Michael McCandless
        2. LUCENE-2504-3x.patch
          3 kB
          Michael McCandless
        3. LUCENE-2531.patch
          5 kB
          Michael McCandless
        4. LUCENE-2531-3x.patch
          4 kB
          Michael McCandless

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: