trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traflm <>
Subject [GitHub] incubator-trafodion pull request #642: [TRAFODION-2119] create table report ...
Date Wed, 10 Aug 2016 00:15:19 GMT
Github user traflm commented on a diff in the pull request:
    --- Diff: core/sql/optimizer/EncodedKeyValue.cpp ---
    @@ -68,14 +68,22 @@ NAString * getMinMaxValue(TrafDesc * column,
         return NULL;
       Lng32 buflen = type->getTotalSize();
    +  Lng32 nullHdrSize = 0;
       char * buf = new char[buflen]; // deleted at the end of this method
    +  if (type->supportsSQLnullPhysical())
    +  {
    +      nullHdrSize = type->getSQLnullHdrSize();
    +      for(int i = 0; i < nullHdrSize; i++)
    --- End diff --
    there are two issues to use memset() here, please keep in mind the nullHdrSize will be
2 or 4
    1. memset is good for large buffer initialization, because it will try to do 8 bytes copy
in parallel and in memory alignment, but for small buffer , it is same as a while loop. memset()
. It will also try to adjust memory alignment, which is useless for 2 or 4 bytes initialization,
but just waste a few CPU cycle.
    2. memset will require a function call.
    And the most important: this is DDL, which performance of this kind of issue is not my

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 or file a JIRA ticket
with INFRA.

View raw message