siddharthteotia commented on a change in pull request #5013: For RANGE 
predicate queries touching offline segments, use sorted inverted index if the 
column is sorted
URL: https://github.com/apache/incubator-pinot/pull/5013#discussion_r370882394
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/SortedInvertedIndexBasedFilterOperator.java
 ##########
 @@ -78,82 +79,92 @@ protected FilterBlock getNextBlock() {
     int[] dictIds = exclusive ? _predicateEvaluator.getNonMatchingDictIds() : 
_predicateEvaluator.getMatchingDictIds();
 
     if (0 < dictIds.length) {
-      // Sort the dictIds in ascending order, so that their respective ranges 
are adjacent if their dictIds are adjacent
-      Arrays.sort(dictIds);
+      if (_predicateEvaluator instanceof 
RangePredicateEvaluatorFactory.OfflineDictionaryBasedRangePredicateEvaluator) {
+        // optimized path for RANGE predicate evaluation using sorted index.
+        // dictIds will already be sorted since we use sorted index based 
evaluation
+        // for RANGE predicates only on offline segments.
+        // so build a pair with startDocId and endDocId
+        IntPair pair1 = invertedIndex.getDocIds(dictIds[0]);
 
 Review comment:
   Good suggestion. Done... no need to call getMatchingDictIds

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to