Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/132#discussion_r42407695
  
    --- Diff: core/sql/optimizer/PartFunc.cpp ---
    @@ -5009,6 +5020,118 @@ void RangePartitioningFunction::print(FILE* ofd, 
const char* indent,
       partitionBoundaries_->print(ofd, indent, title);
     
     } // RangePartitioningFunction::print()
    +
    +
    +NABoolean 
    +compareEncodedKey(const char* low, const char* key, const char* high, 
Int32 keyLen, NABoolean checkLast)
    +{
    +    Int32 cmpLow = memcmp(low, key, keyLen);
    +    Int32 cmpHigh = memcmp(key, high, keyLen);
    +
    +    if ( cmpLow <= 0 && cmpHigh < 0 )
    +       return TRUE;
    +
    +    return (checkLast && cmpLow <= 0 && cmpHigh <= 0);
    +}
    +
    +NABoolean 
    +compareAsciiKey(const char* low, const char* key, const char* high, Int32, 
NABoolean checkLast)
    +{
    +    Int32 cmpLow = strverscmp(low, key);
    +    Int32 cmpHigh = strverscmp(key, high);
    +
    +    if ( cmpLow <= 0 && cmpHigh < 0 )
    +       return TRUE;
    +
    +    return (checkLast && cmpLow <= 0 && cmpHigh <= 0);
    +}
    +
    +
    +// find a boundary pair [low, high) with smallest low value in which keys 
fall, and return the
    --- End diff --
    
    findBeginBoundary starts its search at the end of the partition array, 
while findEndBoundary starts its search at the beginning. I would have thought 
we would have done the opposite. A full scan would cause us to search the 
entire array twice. Though I suppose once we get to 100's of partitions, we'll 
want to change both of these to binary searches.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to