Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 97580 invoked from network); 2 Mar 2006 20:04:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Mar 2006 20:04:18 -0000 Received: (qmail 34249 invoked by uid 500); 2 Mar 2006 20:05:03 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 34212 invoked by uid 500); 2 Mar 2006 20:05:02 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 34201 invoked by uid 99); 2 Mar 2006 20:05:02 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2006 12:05:02 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 1A1F1DC for ; Thu, 2 Mar 2006 21:04:41 +0100 (CET) Message-ID: <501765344.1141329881031.JavaMail.jira@ajax.apache.org> Date: Thu, 2 Mar 2006 21:04:41 +0100 (CET) From: "Mark Harwood (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-509) Performance optimization when retrieving a single field from a document In-Reply-To: <641173675.1141320282688.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/LUCENE-509?page=comments#action_12368590 ] Mark Harwood commented on LUCENE-509: ------------------------------------- >It would be nice if one could get just a few fields in an efficient manner too. I'd like to see that too. I put some code together to do that some time ago: http://marc.theaimsgroup.com/?l=lucene-user&m=108525376821114&w=2 > Performance optimization when retrieving a single field from a document > ----------------------------------------------------------------------- > > Key: LUCENE-509 > URL: http://issues.apache.org/jira/browse/LUCENE-509 > Project: Lucene - Java > Type: Improvement > Components: Index > Versions: 1.9, 2.0 > Reporter: Steven Tamm > Attachments: DocField.patch, DocField_2.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: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org