phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aman Poonia (Jira)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-5493) Remove unnecesary iteration in BaseResultIterator
Date Wed, 25 Sep 2019 09:15:00 GMT
Aman Poonia created PHOENIX-5493:
------------------------------------

             Summary: Remove unnecesary iteration in BaseResultIterator 
                 Key: PHOENIX-5493
                 URL: https://issues.apache.org/jira/browse/PHOENIX-5493
             Project: Phoenix
          Issue Type: Improvement
    Affects Versions: 4.14.3
            Reporter: Aman Poonia
            Assignee: Aman Poonia


In BaseResultIterator
{code:java}
while (offset < nColumnsInCommon && offset < rangesListSize) {
            List<KeyRange> ranges = rangesList.get(offset);
            // We use a skip scan if we have multiple ranges or if
            // we have a non single key range before the last range.
            useSkipScan |= ranges.size() > 1 || hasRange;
            cnf.add(ranges);
            int rangeSpan = 1 + dataScanRanges.getSlotSpans()[offset];
            if (offset + rangeSpan > nColumnsInCommon) {
                rangeSpan = nColumnsInCommon - offset;
                // trim range to only be rangeSpan in length
                ranges = Lists.newArrayListWithExpectedSize(cnf.get(cnf.size()-1).size());
                for (KeyRange range : cnf.get(cnf.size()-1)) {
                    range = clipRange(dataScanRanges.getSchema(), offset, rangeSpan, range);
                    // trim range to be only rangeSpan in length
                    ranges.add(range);
                }
                cnf.set(cnf.size()-1, ranges);
            }
            for (KeyRange range : ranges) {
                if (!range.isSingleKey()) {
                    hasRange = true;
                }
            }
            slotSpan[offset] = rangeSpan - 1;
            offset = offset + rangeSpan;
        }
{code}
 we can break in the inner loop and save some cycles of CPU



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message