phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Hofhansl (Jira)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-5493) Remove unnecesary iteration in BaseResultIterator
Date Fri, 11 Oct 2019 17:19:00 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-5493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lars Hofhansl updated PHOENIX-5493:
-----------------------------------
    Fix Version/s: 4.15.0

> 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
>            Priority: Minor
>             Fix For: 4.13.1, 4.15.0, 5.1.0
>
>         Attachments: PHOENIX-5493.patch
>
>
> 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