Github user nonstop-qfchen commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/30#discussion_r34825375
  
    --- Diff: core/sql/ustat/hs_globals.cpp ---
    @@ -4896,7 +4900,7 @@ void 
HSGlobalsClass::getMemoryRequirementsForOneGroup(HSColGroupStruct* group, I
     // on the amount of memory allocated to hold their values.
     //
     // Note: row count may be adjusted up if DP2 sampling and heavy amount of 
varchars.
    -Int64 HSGlobalsClass::getInternalSortMemoryRequirements()
    +Int64 HSGlobalsClass::getInternalSortMemoryRequirements(NABoolean 
performISForMC)
    --- End diff --
    
    Basically, I removed all references to the CQD 
USTAT_USE_INTERNAL_SORT_FOR_MC
    and replaced it with references to the new data member performISForMC_.
    
    This flag is set to true after we verify that there is enough memory for
    the work, here.
    
    5377         if (trySampleTableBypassForIS && multiGroup ) {
    
     5378
    
     5379               if
    (CmpCommon::getDefault(USTAT_USE_INTERNAL_SORT_FOR_MC) == DF_ON &&
    
     5380                   allGroupsFitInMemory())
    
     5381               {
    
     5382                 // if both single and MC groups can fit in memory,
    turn on
    
     5383                 // performing MC in memory flag.
    
     5384                 //
    
     5385                 // Do not have to set the flag for next call to this
    function
    
     5386                 // (HSGlobalsClass::CollectStatistics()) since it is
    not static and
    
     5387                 // therefore a new HSGlobalsClass object will be
    constructed.
    
     5388                 // In HSGlobalsClass::HSGlobalsClass(), the flag is
    set to FALSE.
    
     5389                 setPerformISForMC(TRUE);
    
     5390
    
     5391               } else {
    
     5392                 // othereise, don't bypass sampling for internal sort.
    
     5393                 trySampleTableBypassForIS = FALSE;
    
     5394               }
    
     5395          }
    
    
    On Thu, Jul 16, 2015 at 1:53 PM, DaveBirdsall <[email protected]>
    wrote:
    
    > In core/sql/ustat/hs_globals.cpp
    > 
<https://github.com/apache/incubator-trafodion/pull/30#discussion_r34824041>
    > :
    >
    > > @@ -4896,7 +4900,7 @@ void 
HSGlobalsClass::getMemoryRequirementsForOneGroup(HSColGroupStruct* group, I
    > >  // on the amount of memory allocated to hold their values.
    > >  //
    > >  // Note: row count may be adjusted up if DP2 sampling and heavy amount 
of varchars.
    > > -Int64 HSGlobalsClass::getInternalSortMemoryRequirements()
    > > +Int64 HSGlobalsClass::getInternalSortMemoryRequirements(NABoolean 
performISForMC)
    >
    > Why is a parameter used here? Is this a "what if" call that sets the
    > static global variable later?
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/incubator-trafodion/pull/30/files#r34824041>.
    >
    
    
    
    -- 
    Regards, --Qifan



---
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