Yonik Seeley wrote:
> On Wed, Oct 7, 2009 at 3:31 PM, Mark Miller <markrmil...@gmail.com> wrote:
>   
>> I can't tell why calling a commit or restarting is going to help
>> anything
>>     
>
> Depends on what scenarios you consider, and what you are taking 2x of.
>
> 1) Open reader on index
> 2) Open writer and add two documents... the first causes a large
> merge, and the second is just to make it a non-optimized index.
>   At this point youre already at 2x of your original index size.
> 3) call optimize()... this will make a 3rd copy before deleting the 2nd.
>
> -Yonik
> http://www.lucidimagination.com
>   
Yup - finally hit me what you were talking about. Wasn't considering the
case of adding docs to an existing index, not committing, and then
trying to optimize.

I like trying to take an opposing side from you anyway - it means I know
where I will end up - but your usually so darn terse, I never know how
long till I end up there.

Anyway, so all you generally *need* is 2x, you just have to make sure
your not adding docs first without committing them - which I was taking
for granted. But means your comment of calling commit makes perfect sense.

I guess you can't guarantee 2x though, as if you have queries coming in
that take a while, a commit opening a new Reader will not guarantee the
old Reader is quite ready to go away. Might want to wait a short bit
after the commit.

-- 
- Mark

http://www.lucidimagination.com



Reply via email to