siddharthteotia commented on code in PR #8764:
URL: https://github.com/apache/pinot/pull/8764#discussion_r880649940


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/dociditerators/SVScanDocIdIterator.java:
##########
@@ -55,6 +58,33 @@ public SVScanDocIdIterator(PredicateEvaluator 
predicateEvaluator, ForwardIndexRe
 
   @Override
   public int next() {
+    if (_cursor >= _batchSize) {
+      int limit;
+      int batchSize = 0;
+      do {
+        limit = Math.min(_numDocs - _nextDocId, OPTIMAL_ITERATOR_BATCH_SIZE);
+        if (limit > 0) {
+          for (int i = 0; i < limit; i++) {
+            _batch[i] = _nextDocId + i;
+          }
+          batchSize = _valueMatcher.matchValues(limit, _batch);
+          _nextDocId += limit;
+          _numEntriesScanned += limit;
+        }
+      } while (limit > 0 & batchSize == 0);
+      _batchSize = batchSize;

Review Comment:
   (nit) calling this `_batchSize` is bit less intuitive considering that this 
is indeed used to track if the cursor is before or after the first non-matching 
index



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to