trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zellerh <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #1228: [TRAFODION-2733] Provide an improved...
Date Tue, 12 Sep 2017 19:13:31 GMT
Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1228#discussion_r138434537
  
    --- Diff: core/sql/generator/GenRelGrby.cpp ---
    @@ -1644,52 +1640,29 @@ CostScalar HashGroupBy::getEstimatedRunTimeMemoryUsage(NABoolean
perCPU)
       CostScalar totalHashTableMemory = 
         childRowCount * (childRecordSize + memOverheadPerRecord);
     
    -  if ( perCPU == TRUE ) {
    -     const PhysicalProperty* const phyProp = getPhysicalProperty();
    -     if (phyProp)
    -     {
    -       PartitioningFunction * partFunc = phyProp -> getPartitioningFunction() ;
    -
    -      // totalHashTableMemory is per CPU at this point of time.
    -       totalHashTableMemory /= partFunc->getCountOfPartitions();
    -     }
    +  Lng32 numOfStreams = 1;
    +  const PhysicalProperty* const phyProp = getPhysicalProperty();
    +  if (phyProp)
    +  {
    +     PartitioningFunction * partFunc = phyProp -> getPartitioningFunction() ;
    +     numOfStreams = partFunc->getCountOfPartitions();
    +     if (numOfStreams <= 0)
    +        numOfStreams = 1;
       }
    +  if (numStreams != NULL)
    +     *numStreams = numOfStreams;
    +  if ( perNode == TRUE ) 
    +     totalHashTableMemory /= MINOF(MAXOF(((NAClusterInfoLinux*)gpClusterInfo)->getTotalNumberOfCPUs(),
1), numOfStreams);
    --- End diff --
    
    same comment as in probe cache about dividing by the number of nodes, if numStreams <
number of nodes.


---

Mime
View raw message