vsop-479 commented on code in PR #13253:
URL: https://github.com/apache/lucene/pull/13253#discussion_r1615722587


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnum.java:
##########
@@ -434,8 +436,29 @@ public boolean seekExact(BytesRef target) throws 
IOException {
         //   System.out.println("  target is before current (shares 
prefixLen=" + targetUpto + ");
         // rewind frame ord=" + lastFrame.ord);
         // }
+
+        // We got lastFrame by comparing target and term, and target less than 
last seeked term in
+        // currentFrame. If lastFrame's fp is same with currentFrame's fp, we 
can reduce entCount to
+        // nextEnt.
+        boolean currentIsLast = currentFrame.fp == lastFrame.fp;
         currentFrame = lastFrame;
-        currentFrame.rewind();
+
+        // Only rewindWithoutReload for non-floor block or first floor block.
+        // TODO: We need currentFrame's first entry to judge whether we can 
rewindWithoutReload for
+        // non-first floor blocks.
+        if (currentFrame.fp != currentFrame.fpOrig

Review Comment:
   > Maybe currentFrame.nextEnt == -1 is enough for both unloaded block, I will 
confirm that.
   
   We may meet a block `nextEnt` is -1 and `entCount` is not 0( set by 
`SegmentTermsEnumFrame.scanToFloorFrame`), but we should not meet a block 
`entCount` is 0 and `nextEnt` is not -1. 
   
   So `currentFrame.nextEnt == -1` is enough for unloaded block.



-- 
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-unsubscr...@lucene.apache.org

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


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

Reply via email to