kishoreg commented on a change in pull request #7530:
URL: https://github.com/apache/pinot/pull/7530#discussion_r723445999
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/operator/dociditerators/SVScanDocIdIterator.java
##########
@@ -72,16 +73,23 @@ public int advance(int targetDocId) {
@Override
public MutableRoaringBitmap applyAnd(ImmutableRoaringBitmap docIds) {
- MutableRoaringBitmap result = new MutableRoaringBitmap();
- IntIterator docIdIterator = docIds.getIntIterator();
- int nextDocId;
- while (docIdIterator.hasNext() && (nextDocId = docIdIterator.next()) <
_numDocs) {
- _numEntriesScanned++;
- if (_valueMatcher.doesValueMatch(nextDocId)) {
- result.add(nextDocId);
+ RoaringBitmapWriter<MutableRoaringBitmap> result =
RoaringBitmapWriter.bufferWriter()
+ .expectedRange(0, _numDocs).runCompress(false).get();
+ BatchIterator docIdIterator = docIds.getBatchIterator();
+ int[] buffer = new int[256];
Review comment:
I am guessing there is some study within roaringbitmap library that says
256 is the right size because of how the compression works? If yes, then it
will be good to make 256 a constant and add a comment on why we pick 256.
--
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]