You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "luyuncheng (via GitHub)" <gi...@apache.org> on 2023/05/08 14:41:54 UTC

[GitHub] [lucene] luyuncheng opened a new pull request, #12273: Remove unnecessary sort in writeFieldUpdates

luyuncheng opened a new pull request, #12273:
URL: https://github.com/apache/lucene/pull/12273

   We have many docValues field update scenarios especially enabled **softDeletes**. so we re check the logic in `ReadersAndUpdates`. i think the following sort logic is unnecessary
   
   ```
    Collections.sort(updates, Comparator.comparingLong(a -> a.delGen)); 
   ```
   
   because sort need `O(n lg(n))` iterator, ant then scan List<DocValuesFieldUpdates>.  we can save this operation.
   
   
   `pendingDVUpdates` all uses in 
   https://github.com/apache/lucene/blob/a39885fdab93c4cbbcab8f3112c9783a05ca15a9/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java#L557-L566
   
   AND
   
   iterator all  `List<DocValuesFieldUpdates>` to  Prune the now-written DV updates:
   https://github.com/apache/lucene/blob/a39885fdab93c4cbbcab8f3112c9783a05ca15a9/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java#L658-L666
   
   it is unnecessary to sort with increasing delGen.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Remove unnecessary sort in writeFieldUpdates [lucene]

Posted by "mikemccand (via GitHub)" <gi...@apache.org>.
mikemccand commented on PR #12273:
URL: https://github.com/apache/lucene/pull/12273#issuecomment-1790634871

   Merged & backported to 9.9.0.  Sorry for the long delay @luyuncheng!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Remove unnecessary sort in writeFieldUpdates [lucene]

Posted by "mikemccand (via GitHub)" <gi...@apache.org>.
mikemccand merged PR #12273:
URL: https://github.com/apache/lucene/pull/12273


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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