Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 13238 invoked from network); 10 Nov 2009 14:01:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Nov 2009 14:01:55 -0000 Received: (qmail 27834 invoked by uid 500); 10 Nov 2009 14:01:53 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 27690 invoked by uid 500); 10 Nov 2009 14:01:52 -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 27681 invoked by uid 99); 10 Nov 2009 14:01:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 14:01:52 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 14:01:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 245D8234C4B1 for ; Tue, 10 Nov 2009 06:01:30 -0800 (PST) Message-ID: <1078329564.1257861690147.JavaMail.jira@brutus> Date: Tue, 10 Nov 2009 14:01:30 +0000 (UTC) From: "Fuad Efendi (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Issue Comment Edited: (LUCENE-1990) Add unsigned packed int impls in oal.util In-Reply-To: <486796805.1255870411278.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12775420#action_12775420 ] Fuad Efendi edited comment on LUCENE-1990 at 11/10/09 2:01 PM: --------------------------------------------------------------- Specifically for FieldCache, let's see... suppose Field may have 8 different values, and number of documents is high. {code} Value0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 ... Value1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 ... Value2 0 0 0 1 1 0 0 0 0 0 0 0 0 0 ... Value3 0 0 0 0 0 0 0 0 0 0 0 1 0 0 ... Value4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ... Value5 0 0 0 0 0 1 0 0 0 0 1 0 1 0 ... Value6 0 0 0 0 0 0 0 1 0 1 0 0 0 0 ... Value7 0 0 0 0 0 0 0 0 1 0 0 0 0 1 ... {code} - represented as Matrix (or as a Vector); for instance, first row means that Document1 and Document8 have Value0. And now, if we go "horizontally" we will end up with 8 arrays of int[]. What if we go "vertically"? Field could be encoded as 3-bit (8 different values). CONSTRAINT: specifically for FieldCache, each Column must have the only "1". And we can end with array of 3-bit values storing position in a column! Size of array is IndexReader.maxDoc(). hope I am reinventing bycycle :) was (Author: funtick): Specifically for FieldCache, let's see... suppose Field may have 8 different values, and number of documents is high. {code} Value0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 ... Value1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 ... Value2 0 0 0 1 1 0 0 0 0 0 0 0 0 0 ... Value3 0 0 0 0 0 0 0 0 0 0 0 10 0 0 ... Value4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ... Value5 0 0 0 0 0 1 0 0 0 0 1 0 1 0 ... Value6 0 0 0 0 0 0 0 1 0 1 0 0 0 0 ... Value7 0 0 0 0 0 0 0 0 1 0 0 0 0 1 ... {code} - represented as Matrix (or as a Vector); for instance, first row means that Document1 and Document8 have Value0. And now, if we go "horizontally" we will end up with 8 arrays of int[]. What if we go "vertically"? Field could be encoded as 3-bit (8 different values). CONSTRAINT: specifically for FieldCache, each Column must have the only "1". And we can end with array of 3-bit values storing position in a column! Size of array is IndexReader.maxDoc(). hope I am reinventing bycycle :) > Add unsigned packed int impls in oal.util > ----------------------------------------- > > Key: LUCENE-1990 > URL: https://issues.apache.org/jira/browse/LUCENE-1990 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Reporter: Michael McCandless > Priority: Minor > > There are various places in Lucene that could take advantage of an > efficient packed unsigned int/long impl. EG the terms dict index in > the standard codec in LUCENE-1458 could subsantially reduce it's RAM > usage. FieldCache.StringIndex could as well. And I think "load into > RAM" codecs like the one in TestExternalCodecs could use this too. > I'm picturing something very basic like: > {code} > interface PackedUnsignedLongs { > long get(long index); > void set(long index, long value); > } > {code} > Plus maybe an iterator for getting and maybe also for setting. If it > helps, most of the usages of this inside Lucene will be "write once" > so eg the set could make that an assumption/requirement. > And a factory somewhere: > {code} > PackedUnsignedLongs create(int count, long maxValue); > {code} > I think we should simply autogen the code (we can start from the > autogen code in LUCENE-1410), or, if there is an good existing impl > that has a compatible license that'd be great. > I don't have time near-term to do this... so if anyone has the itch, > please jump! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org