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

FieldComparator.TermOrdValComparator compares by value unnecessarily

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      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-2531-3x.patch
          4 kB
          Michael McCandless
        2. LUCENE-2531.patch
          5 kB
          Michael McCandless
        3. LUCENE-2504-3x.patch
          3 kB
          Michael McCandless
        4. LUCENE-2504.patch
          3 kB
          Michael McCandless

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: