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

Performance optimization when retrieving a single field from a document

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.9, 2.0.0
    • None
    • core/index
    • None

    Description

      If you just want to retrieve a single field from a Document, the only way to do it is to retrieve all the fields from the Document and then search it. This patch is an optimization that allows you retrieve a specific field from a document without instantiating a lot of field and string objects. This reduces our memory consumption on a per query basis by around around 20% when a lot of documents are returned.

      I've added a lot of comments saying you should only call it if you only ever need one field. There's also a unit test.

      Attachments

        1. DocField_2.patch
          9 kB
          Steven Tamm
        2. DocField_3.patch
          13 kB
          Steven Tamm
        3. DocField_4.patch
          17 kB
          Steven Tamm
        4. DocField_4b.patch
          18 kB
          Steven Tamm
        5. DocField.patch
          7 kB
          Steven Tamm

        Issue Links

          Activity

            People

              otis Otis Gospodnetic
              tamm Steven Tamm
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: