Jackie-Jiang 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_r370805944
##########
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:
This is not efficient. We should add getStartDictId() and getEndDictId() to
OfflineDictionaryBasedRangePredicateEvaluator, and directly get the start and
end dict id.
----------------------------------------------------------------
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]