richardstartin commented on a change in pull request #7513:
URL: https://github.com/apache/pinot/pull/7513#discussion_r721744569



##########
File path: 
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/BitSlicedRangeIndexReader.java
##########
@@ -97,12 +106,22 @@ public ImmutableRoaringBitmap 
getPartiallyMatchingDocIds(double min, double max)
     return null;
   }
 
-  private ImmutableRoaringBitmap queryRangeBitmap(long min, long max) {
+  private ImmutableRoaringBitmap queryRangeBitmap(long min, long max, long 
columnMax) {
     RangeBitmap rangeBitmap = mapRangeBitmap();
-    RoaringBitmap lte = rangeBitmap.lte(max);
-    RoaringBitmap gte = rangeBitmap.gte(min);
-    lte.and(gte);
-    return lte.toMutableRoaringBitmap();
+    if (Long.compareUnsigned(max, columnMax) < 0) {
+      RoaringBitmap lte = rangeBitmap.lte(max);
+      if (Long.compareUnsigned(min, 0) > 0) {

Review comment:
       It's an unsigned comparison, values stored in the index start at 0 and 
effectively end at -1L. This feels more readable, but checking it's not 0 is 
probably faster.




-- 
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