trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #815: [TRAFODION-2326] TopN sort reuse of r...
Date Thu, 03 Nov 2016 18:25:47 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/815#discussion_r86406998
  
    --- Diff: core/sql/executor/ex_sort.cpp ---
    @@ -96,6 +96,72 @@ ExOperStats * ExSortTcb::doAllocateStatsEntry(CollHeap *heap,
       return stat;
     }
     
    +void ExSortTcb::setupPoolBuffers(ex_queue_entry *pentry_down)
    +{
    +  CollHeap  *space = getGlobals()->getSpace();
    +  
    +  // Allocate the buffer pool.
    +  // Note that when memoryQuota system is enabled, we initialize the
    +  // pool with atleast 2 buffer. This is to accomodate sort to progress
    +  // even under extremely loaded environment(memory pressure)irrespective
    +  // of memory quota system. The buffer size is calculated taking into
    +  // account the estimate number of rows by the compiler and limited by
    +  // maximum of GEN_SORT_MAX_BUFFER_SIZE. The memory quota system will
    +  // come into force for additional buffers following this initial buffer.
    +  Lng32 numBuffs = (sortTdb().sortOptions_->memoryQuotaMB()<= 0)?sortTdb().numBuffers_:2;
    +  Lng32 numSortBuffs = 0;
    +
    +  // need separate pools for sorting and saving result rows
    +  if (sortTdb().partialSort())
    +  {
    +     // give result pool and sort pool each half of the space
    +     numSortBuffs = numBuffs = (numBuffs + 1)/2;
    --- End diff --
    
    So, if numBuffs is set to 3 at line 111, then line 118 will set numSortBuffs to 2 and
numBuffs to 2, exceeding the limit of 3. Was that your intent?


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

Mime
View raw message