You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Sriram Sankar <sa...@gmail.com> on 2013/06/25 18:49:01 UTC

Strategy for optimal read-only index

I have a use case where I build my index only occasionally and am willing
to pay the cost to build a read-only index that occupies as small a memory
footprint as possible and also remains efficient for  posting list
traversal.  I.e., I will not be making any changes at all once it is built.

1. What is the best strategy to build this index - is there the equivalent
of an "optimize()" method (it seems to be gone now, is there a specific
codec I can use, etc.

2. Do we get any better read (posting list traversal essentially)
performance by doing this (as opposed to using a mutable index)?

Thanks,

Sriram.

Re: Strategy for optimal read-only index

Posted by Sriram Sankar <sa...@gmail.com>.
Thanks!

Sriram.


On Tue, Jun 25, 2013 at 10:01 AM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> On Tue, Jun 25, 2013 at 12:49 PM, Sriram Sankar <sa...@gmail.com> wrote:
> > I have a use case where I build my index only occasionally and am willing
> > to pay the cost to build a read-only index that occupies as small a
> memory
> > footprint as possible and also remains efficient for  posting list
> > traversal.  I.e., I will not be making any changes at all once it is
> built.
> >
> > 1. What is the best strategy to build this index - is there the
> equivalent
> > of an "optimize()" method (it seems to be gone now, is there a specific
> > codec I can use, etc.
>
> optimize() was renamed to forceMerge(1)
>
> > 2. Do we get any better read (posting list traversal essentially)
> > performance by doing this (as opposed to using a mutable index)?
>
> You save seeks when the index has only one segment (optimized) but if
> the index fits entirely in RAM this may not matter much.
>
> You also have fewer open files, in case that matters...
>
> Test both and report back!
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Strategy for optimal read-only index

Posted by Michael McCandless <lu...@mikemccandless.com>.
On Tue, Jun 25, 2013 at 12:49 PM, Sriram Sankar <sa...@gmail.com> wrote:
> I have a use case where I build my index only occasionally and am willing
> to pay the cost to build a read-only index that occupies as small a memory
> footprint as possible and also remains efficient for  posting list
> traversal.  I.e., I will not be making any changes at all once it is built.
>
> 1. What is the best strategy to build this index - is there the equivalent
> of an "optimize()" method (it seems to be gone now, is there a specific
> codec I can use, etc.

optimize() was renamed to forceMerge(1)

> 2. Do we get any better read (posting list traversal essentially)
> performance by doing this (as opposed to using a mutable index)?

You save seeks when the index has only one segment (optimized) but if
the index fits entirely in RAM this may not matter much.

You also have fewer open files, in case that matters...

Test both and report back!

Mike McCandless

http://blog.mikemccandless.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org