lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <>
Subject [jira] Commented: (LUCENE-509) Performance optimization when retrieving a single field from a document
Date Thu, 02 Mar 2006 18:18:40 GMT
    [ ] 

Doug Cutting commented on LUCENE-509:

This seems like a fine idea.  But unless I'm mistaken, there's a bug when fields are strings
that contain characters > 127.  With strings, the length written is (unfortunately) the
number of Java characters, not the number of bytes.  There has been a lot of discussion about
eventually changing this to be the number of bytes, but that has not yet happened.  So, until
that happens, we'd have to scan the UTF8 for string values, counting characters, rather than
simply seeking ahead.

> Performance optimization when retrieving a single field from a document
> -----------------------------------------------------------------------
>          Key: LUCENE-509
>          URL:
>      Project: Lucene - Java
>         Type: Improvement
>   Components: Index
>     Versions: 1.9, 2.0
>     Reporter: Steven Tamm
>  Attachments: DocField.patch
> 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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message