[ 
https://issues.apache.org/jira/browse/LUCENE-10574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17538448#comment-17538448
 ] 

Adrien Grand commented on LUCENE-10574:
---------------------------------------

It's not about absolute segment sizes, it's more about computing balanced 
merges. Say you have N 1-document segments and want to merge them down to a 
single segment, 10 segments at a time. If you always compute perfectly balanced 
merges then each document participates in O(log(N)) merges so it takes O(N 
log(N)) to get down to a single segment. If you take the naive approach of 
always merging the biggest segment you got so far with 9 1-document segments 
then each document participates in O(N) merges so it takes O(N^2) to get down 
to a single segment.

As bad as the second approach sounds, this is what TieredMergePolicy does with 
segments that are below the floor segment size.

> Remove O(n^2) from TieredMergePolicy or change defaults to one that doesn't 
> do this
> -----------------------------------------------------------------------------------
>
>                 Key: LUCENE-10574
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10574
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Priority: Major
>
> Remove {{floorSegmentBytes}} parameter, or change lucene's default to a merge 
> policy that doesn't merge in an O(n^2) way.
> I have the feeling it might have to be the latter, as folks seem really wed 
> to this crazy O(n^2) behavior.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to