[
https://issues.apache.org/jira/browse/TRAFODION-2326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15635527#comment-15635527
]
ASF GitHub Bot commented on TRAFODION-2326:
-------------------------------------------
Github user prashanth-vasudev commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/815#discussion_r86497624
--- Diff: core/sql/executor/ex_sort.cpp ---
@@ -183,6 +212,11 @@ ExSortTcb::ExSortTcb(const ExSortTdb & sort_tdb,
processedInputs_ = qparent_.down->getTailIndex();
workAtp_ = allocateAtp(sort_tdb.workCriDesc_, space);
workAtp_->getTupp(2) = new(space) tupp_descriptor();
+
+ //buffer pools are allocated in SORT_PREP work phase.
+ topNSortPool_ = NULL;
+ regularSortPool_ = NULL;
+ partialSortPool_ = NULL;
--- End diff --
I will make this change. ReceivePool_ and sortPool_ are assigned a value
always during sort prep step. But assigning to null is safe in case of error
scenarios.
> TopN sort consumes more memory than needed.
> -------------------------------------------
>
> Key: TRAFODION-2326
> URL: https://issues.apache.org/jira/browse/TRAFODION-2326
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-exe
> Affects Versions: 2.1-incubating
> Reporter: Prashanth Vasudev
> Assignee: Prashanth Vasudev
>
> Records that get discarded , those that do not belong to TopN rows, release
> reference to the tupp descriptor, however the released tuple memory does not
> get reused for new records from child nodes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)