richardstartin commented on a change in pull request #7513:
URL: https://github.com/apache/pinot/pull/7513#discussion_r721771958
##########
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:
I don't want to change this because it's less surprising if all of the
comparisons use `Long.compareUnsigned` than if only the ones that can't be
optimised to something else do. The other operations here will take at least
10s of microseconds even for small segments, so this isn't worth optimising IMO.
--
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]