[ 
https://issues.apache.org/jira/browse/TRAFODION-2604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15998794#comment-15998794
 ] 

ASF GitHub Bot commented on TRAFODION-2604:
-------------------------------------------

Github user prashanth-vasudev commented on a diff in the pull request:

    
https://github.com/apache/incubator-trafodion/pull/1081#discussion_r115067125
  
    --- Diff: core/sql/executor/ex_sort.cpp ---
    @@ -218,7 +304,8 @@ ExSortTcb::ExSortTcb(const ExSortTdb & sort_tdb,
       sortStats_ = NULL;
       childTcb_ = &child_tcb;
     
    -  CollHeap * space = glob->getSpace();
    +  //Create heap to be used by sort.
    +  sortHeap_ = new(getHeap()) NAHeap("Sort Heap", (NAHeap *)getHeap(), 
204800);
    --- End diff --
    
    SortHeap is used to allocate internal data structures to accommodate 
initial default number of 1 million records. The hard coded value of 200kb is 
the block size hint given to NAheap. This value will help allocations that are 
not too big or too small for sort.  SortHeap is initialized only at one place 
in sort and also this value is not a tune-able parameter , hence kept it as is 
and did not make it as a define or cqd. 
    
    SORT_MAX_HEAP_SIZE_MB cqd defaults to 800MB , this is the max limit that 
will be enforced if quota system is not enforced for sort.


> sort operator merge phase memory pool improvement 
> --------------------------------------------------
>
>                 Key: TRAFODION-2604
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2604
>             Project: Apache Trafodion
>          Issue Type: Bug
>            Reporter: Prashanth Vasudev
>            Assignee: Prashanth Vasudev
>             Fix For: 2.2-incubating
>
>
> Currently, executor sort goes through initial sort phase followed by merge 
> phase in overflow situation. The memory pool used during sort phase is not 
> efficiently reused for merge phase , causing sort merge to slow down in case 
> of large merge. Sort merge happens only if sort overflows.
> Fix is to detect overflow situation and reuse the memory pool for merge phase.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to