You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/11/16 17:11:03 UTC
[6/7] incubator-trafodion git commit: fixes reuse of allocated pools.
fixes reuse of allocated pools.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/efdda8bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/efdda8bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/efdda8bc
Branch: refs/heads/master
Commit: efdda8bcbc13e5738399d53edd16139987d0af42
Parents: 5bad575
Author: Prashant Vasudev <pr...@esgyn.com>
Authored: Fri Nov 11 16:14:49 2016 +0000
Committer: Prashant Vasudev <pr...@esgyn.com>
Committed: Fri Nov 11 16:14:49 2016 +0000
----------------------------------------------------------------------
core/sql/executor/ex_sort.cpp | 6 ++++++
core/sql/sort/SortTopN.cpp | 7 +++++--
2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/efdda8bc/core/sql/executor/ex_sort.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_sort.cpp b/core/sql/executor/ex_sort.cpp
index caf0dfe..3b2b15a 100644
--- a/core/sql/executor/ex_sort.cpp
+++ b/core/sql/executor/ex_sort.cpp
@@ -98,6 +98,12 @@ ExOperStats * ExSortTcb::doAllocateStatsEntry(CollHeap *heap,
void ExSortTcb::setupPoolBuffers(ex_queue_entry *pentry_down)
{
+ //if any of these pools is already allocated, most likely
+ //from a prepare once execute many scenario, then no need
+ //to reallocate the pool again. Just return.
+ if(partialSortPool_ || topNSortPool_ || regularSortPool_)
+ return;
+
CollHeap *space = getGlobals()->getSpace();
// Allocate the buffer pool.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/efdda8bc/core/sql/sort/SortTopN.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sort/SortTopN.cpp b/core/sql/sort/SortTopN.cpp
index 526e7d2..90b56d7 100644
--- a/core/sql/sort/SortTopN.cpp
+++ b/core/sql/sort/SortTopN.cpp
@@ -93,8 +93,11 @@ SortTopN::~SortTopN(void)
{
if (topNKeys_ != NULL)
{
- for (int i = 0; i < runSize_; i++)
- topNKeys_[i].rec_->releaseTupp();
+ //No need to release the tupps here
+ //since these tupps are consumed by
+ //parent operators and released.
+ //for (int i = 0; i < runSize_; i++)
+ //topNKeys_[i].rec_->releaseTupp();
NADELETEBASIC(topNKeys_, heap_);
topNKeys_ = NULL;