You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2017/03/28 21:02:07 UTC

[1/6] incubator-trafodion git commit: [TRAFODION-2420] RMS enhancements Introduced 2 new counters HeapWM: - "SQL Heap WM" - Tracks the high water mark of the used memory including space buffer and bmo operator memory. It is enough to moni

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 9b3c71ee4 -> 4716b3ae2


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/regress/core/FILTERRTS
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/FILTERRTS b/core/sql/regress/core/FILTERRTS
index 9c97d13..870ca4a 100755
--- a/core/sql/regress/core/FILTERRTS
+++ b/core/sql/regress/core/FILTERRTS
@@ -6,6 +6,9 @@ if [ "$fil" = "" ]; then
   exit 1
 fi
 sed  "
+/SE IOs  SE IO Bytes/{N
+s/[A-Z0-9 ,]*\.[A-Z0-9]*\.TSTAT/#CAT.#SCH.TSTAT pertableStats/
+}
 s/QID[ ]*MXID[A-Z0-9_]*/QID @QID@/
 s/QID[ ]*'MXID[A-Z0-9_]*'/QID '@QID@'/
 s/Qid[ ]*MXID[A-Z0-9_]*/Qid @QID@/
@@ -80,21 +83,12 @@ s/IPC Memory Used[ 0-9]*/IPC Memory Used @exeMemory@/
 s/EXE Memory Used[ 0-9]*/EXE Memory Used @ipcMemory@/
 s/PID[0-9 ]*/PID @pid@/
 s/RMS Stats Reset Timestamp[ ]*[0-9]*\/[0-9]*\/[0-9]* [0-9]*:[0-9]*:[0-9]*.[0-9]*/RMS Stats Reset Timestamp @rmsStatsResetTimestamp@/
-/8 EX_HASH_GRBY[A-Z ]*/{N
-s/8 EX_HASH_GRBY[A-Z ]*\n[0-9, -]*/8 #ex_hash_grby bmoStats/
-}
-/bmoStats[ ]*/{N
-s/bmoStats[ ]*\n[0-9, -]*/@bmoStats@/
-}
-/6     EX_HASH_GRBY[A-Z ]*/{N
-s/6     EX_HASH_GRBY[A-Z ]*[0-9, -]*\n[0-9, -]*/6 #ex_hash_grby bmoStats/
-}
 s/EX_ROOT[ ]*[0-9, |]*/EX_ROOT @exRootCounters@/
 s/EX_SPLIT_TOP[ ]*[0-9, |]*/EX_SPLIT_TOP @exSplitTopCounters@/
 s/EX_SPLIT_BOTTOM[ ]*[0-9, |]*/EX_SPLIT_BOTTOM @exSplitBottomCounters@/
 s/EX_SEND_TOP[ ]*[0-9, |]*/EX_SEND_TOP @exSendTopCounters@/
 s/EX_SEND_BOTTOM[ ]*[0-9, |]*/EX_SEND_BOTTOM @exSendBottomCounters@/
-s/EX_HASH_GRBY[ ]*[0-9, |A-Z]*/EX_HASH_GRBY @exHashGrbyCounters@/
+s/EX_HASH_GRBY[ ]*[0-9, -|A-Z]*/EX_HASH_GRBY @exHashGrbyCounters@/
 s/EX_PARTN_ACCESS[ ]*[A-Za-z0-9, |.#]*/EX_PARTN_ACCESS @exPartnAccessCounters@/
 s/EX_EID_ROOT[ ]*[0-9, |]*/EX_EID_ROOT @exEidRootCounters@/
 s/EX_TRAF_KEY_SELECT[ ]*[0-9, |]*/EX_TRAF_KEY_SELECT @exTrafKeySelectCounters@/

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/regress/core/TESTRTS
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TESTRTS b/core/sql/regress/core/TESTRTS
index e206bef..fa00d5d 100755
--- a/core/sql/regress/core/TESTRTS
+++ b/core/sql/regress/core/TESTRTS
@@ -163,6 +163,7 @@ get statistics for qid current ;
 get statistics for qid current accumulated ;
 get statistics for qid current pertable ;
 get statistics for qid current progress ;
+get statistics for qid current progress, options 'sl' ;
 get statistics for qid current default ;
 set session default statistics_view_type 'default' ;
 get statistics for qid current ;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/sort/scratchfile_sq.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sort/scratchfile_sq.cpp b/core/sql/sort/scratchfile_sq.cpp
index 70a4e52..9a4d6d7 100644
--- a/core/sql/sort/scratchfile_sq.cpp
+++ b/core/sql/sort/scratchfile_sq.cpp
@@ -765,15 +765,23 @@ Int32 SQScratchFile::redriveVectorIO(Int32 index)
 	  {
 		if(type_ == PEND_READ)
 		{
+		  if (bmoStats)
+                      bmoStats->getScratchIOTimer().start();
 		  bytesCompleted = readv(fileHandle_[index].fileNum, (struct iovec*)remainingAddr_, remainingVectorSize_);
-		  if(bmoStats)
-			bmoStats->incScratchReadCount();
+		  if (bmoStats) {
+                     bmoStats->incScratchReadCount();
+                     bmoStats->getScratchIOTimer().stop();
+                  }
 		}
 		else
 		{
+		  if (bmoStats)
+                      bmoStats->getScratchIOTimer().start();
 		  bytesCompleted = writev(fileHandle_[index].fileNum, (struct iovec*)remainingAddr_, remainingVectorSize_);
-		  if(bmoStats)
-			bmoStats->incScratchWriteCount();
+		  if (bmoStats) {
+                     bmoStats->incScratchWriteCount();
+                     bmoStats->getScratchIOTimer().stop();
+                  }
 		}
 
 		if(bytesCompleted == -1)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/sqlci/SqlciStats.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciStats.cpp b/core/sql/sqlci/SqlciStats.cpp
index ea15aee..5f77dfb 100644
--- a/core/sql/sqlci/SqlciStats.cpp
+++ b/core/sql/sqlci/SqlciStats.cpp
@@ -128,9 +128,9 @@ short SqlciStats::displayStats(SqlciEnv * sqlci_env)
   if (statsOptions_)
   {
      if (strcmp(statsOptions_, "PERTABLE") == 0)
-        strcat(newStr, "FOR QID CURRENT PERTABLE ");
+        strcat(newStr, "FOR QID CURRENT PERTABLE, OPTIONS 'SL'");
      else if (strcmp(statsOptions_, "PROGRESS") == 0)
-        strcat(newStr, "FOR QID CURRENT PROGRESS ");
+        strcat(newStr, "FOR QID CURRENT PROGRESS, OPTIONS 'SL'");
      else if (strcmp(statsOptions_, "DEFAULT") == 0)
         strcat(newStr, "FOR QID CURRENT DEFAULT ");
      else if (strcmp(statsOptions_, "ALL") == 0)
@@ -148,7 +148,7 @@ short SqlciStats::displayStats(SqlciEnv * sqlci_env)
   statsDisplay_ = FALSE;
   if (displayAll)
   {
-     strcpy(newStr, "GET STATISTICS FOR QID CURRENT PROGRESS ;");
+     strcpy(newStr, "GET STATISTICS FOR QID CURRENT PROGRESS , OPTIONS 'SL'");
      DML dml(newStr, DML_DESCRIBE_TYPE, "__MXCI_GET_STATS__");
      retcode = dml.process(sqlci_env);
      strcpy(newStr, "GET STATISTICS FOR QID CURRENT DEFAULT ;");


[4/6] incubator-trafodion git commit: [TRAFODION-2420] RMS enhancements Introduced 2 new counters HeapWM: - "SQL Heap WM" - Tracks the high water mark of the used memory including space buffer and bmo operator memory. It is enough to moni

Posted by su...@apache.org.
[TRAFODION-2420] RMS enhancements
Introduced 2 new counters
HeapWM: - "SQL Heap WM" - Tracks the high water mark of the used memory
        including space buffer and bmo operator memory. It is enough to
        monitor this counter alone to track the memory utilization of the
        query.

scrIOTime: "Scr. IO Time" - Tracks the IO time taken to read/write to
        the scratch files at BMO operator level

Introduced a 'Single line Format' option to display BMO stats and SE stats
in a single line format to enable exporting the output to Excel easily.

GET STATISTICS FOR QID CURRENT PROGRESS, OPTIONS 'SL'

Removed and cleaned up the code further

Also fixed memory corruption issues seen with GET STATISTICS command.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/ae3eca8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/ae3eca8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/ae3eca8a

Branch: refs/heads/master
Commit: ae3eca8a46779828281143db01c171f052947d33
Parents: 39de987
Author: selvaganesang <se...@esgyn.com>
Authored: Mon Mar 27 23:13:10 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Mon Mar 27 23:13:10 2017 +0000

----------------------------------------------------------------------
 .../java/org/trafodion/ci/DatabaseQuery.java    |    6 +-
 core/sql/cli/Statement.cpp                      |    4 +-
 core/sql/cli/sqlcli.h                           |    4 +-
 core/sql/comexe/ComTdbExeUtil.h                 |    7 +-
 core/sql/executor/ExExeUtil.h                   |    4 +-
 core/sql/executor/ExExeUtilGetStats.cpp         |  564 +++---
 core/sql/executor/ExStats.cpp                   |  661 ++-----
 core/sql/executor/ExStats.h                     |  150 +-
 core/sql/generator/GenRelExeUtil.cpp            |    2 +-
 core/sql/optimizer/RelExeUtil.cpp               |    7 +-
 core/sql/optimizer/RelExeUtil.h                 |    2 +
 core/sql/parser/sqlparser.y                     |    4 +-
 core/sql/regress/core/EXPECTEDRTS               | 1835 +++++++++---------
 core/sql/regress/core/FILTERRTS                 |   14 +-
 core/sql/regress/core/TESTRTS                   |    1 +
 core/sql/sort/scratchfile_sq.cpp                |   16 +-
 core/sql/sqlci/SqlciStats.cpp                   |    6 +-
 17 files changed, 1482 insertions(+), 1805 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java
----------------------------------------------------------------------
diff --git a/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java b/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java
index ec57060..c3bb9f3 100644
--- a/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java
+++ b/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java
@@ -309,16 +309,16 @@ public class DatabaseQuery extends QueryWrapper
          String qryRowCnt = qryObj.getRowCount();
          if (sessObj.getSessionStatsType().equals("ALL"))
          {
-            queryStr = "GET STATISTICS FOR QID CURRENT PROGRESS";
+            queryStr = "GET STATISTICS FOR QID CURRENT PROGRESS, OPTIONS 'SL'";
             qryObj.resetQueryText(queryStr);
             parser.setRemainderStr(queryStr);
             qryObj.setRowCount(null);
             execGet(false);
          }
          if (sessObj.getSessionStatsType().equals("PERTABLE"))
-            queryStr = "GET STATISTICS FOR QID CURRENT PERTABLE";
+            queryStr = "GET STATISTICS FOR QID CURRENT PERTABLE, OPTIONS 'SL'";
          else if (sessObj.getSessionStatsType().equals("PROGRESS"))
-            queryStr = "GET STATISTICS FOR QID CURRENT PROGRESS";
+            queryStr = "GET STATISTICS FOR QID CURRENT PROGRESS, OPTIONS 'SL'";
          else if (sessObj.getSessionStatsType().equals("DEFAULT"))
             queryStr = "GET STATISTICS FOR QID CURRENT DEFAULT";
          else if (sessObj.getSessionStatsType().equals("ALL"))

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/cli/Statement.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Statement.cpp b/core/sql/cli/Statement.cpp
index d1a0bcc..ce213c1 100644
--- a/core/sql/cli/Statement.cpp
+++ b/core/sql/cli/Statement.cpp
@@ -293,8 +293,8 @@ Statement::Statement(SQLSTMT_ID * statement_id_,
              context_, (Lng32) context_->getContextHandle());
 
   clonedStatements = new(&heap_) Queue(&heap_);
-  // for now a statement space is allocated from the executor memory
-  space_.setParent(context_->exHeap());
+  // for now a statement space is allocated from the statement heap 
+  space_.setParent(&heap_);
 
   // Set up a space object which might be used during unpacking to allocate
   // additional space for potential upgrading of objects in the plan. This

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/cli/sqlcli.h
----------------------------------------------------------------------
diff --git a/core/sql/cli/sqlcli.h b/core/sql/cli/sqlcli.h
index 342348e..2080982 100644
--- a/core/sql/cli/sqlcli.h
+++ b/core/sql/cli/sqlcli.h
@@ -1111,6 +1111,7 @@ enum SQLSTATS_ITEM_ID {
   SQLSTATS_PHYS_MEM_IN_USE = 67,
   SQLSTATS_SQL_MAX_WAIT_TIME = 68,
   SQLSTATS_SQL_AVG_WAIT_TIME = 69,
+  SQLSTATS_SQL_HEAP_WM = 71,
 
 /* SQLSTATS_ITEM_ID for SQLSTATS_DESC_PERTABLE_STATS */
   SQLSTATS_TABLE_ANSI_NAME = 70,
@@ -1169,8 +1170,6 @@ enum SQLSTATS_ITEM_ID {
   SQLSTATS_BMO_HEAP_WM = 152,
   SQLSTATS_BMO_SPACE_BUFFER_SIZE = 153,
   SQLSTATS_BMO_SPACE_BUFFER_COUNT = 154,
-  SQLSTATS_OVEFLOW_PHASE_STARTTIME = 155,
-  SQLSTATS_OVERFLOW_PHASE = 156,
   SQLSTATS_SCRATCH_FILE_COUNT = 157,
   SQLSTATS_SCRATCH_BUFFER_BLOCK_SIZE = 158,
   SQLSTATS_SCRATCH_BUFFER_BLOCKS_READ = 159,
@@ -1178,6 +1177,7 @@ enum SQLSTATS_ITEM_ID {
   SQLSTATS_SCRATCH_OVERFLOW_MODE = 161,
   SQLSTATS_SCRATCH_READ_COUNT = 162,
   SQLSTATS_SCRATCH_WRITE_COUNT = 163,
+  SQLSTATS_SCRATCH_IO_TIME = 155,
 /* SQLSTATS_ITEM_ID for UDR_BASE_STATS */
   SQLSTATS_UDR_CPU_BUSY_TIME = 170,
   SQLSTATS_RECENT_REQ_TS = 171,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/comexe/ComTdbExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.h b/core/sql/comexe/ComTdbExeUtil.h
index 58c032f..404a8fd 100644
--- a/core/sql/comexe/ComTdbExeUtil.h
+++ b/core/sql/comexe/ComTdbExeUtil.h
@@ -1829,6 +1829,10 @@ public:
   {(v ? flags_ |= TOKENIZED_FORMAT : flags_ &= ~TOKENIZED_FORMAT); };
   NABoolean tokenizedFormat() { return (flags_ & TOKENIZED_FORMAT) != 0; };
 
+  void setSingleLineFormat(NABoolean v)
+  {(v ? flags_ |= SINGLELINE_FORMAT : flags_ &= ~SINGLELINE_FORMAT); };
+  NABoolean singleLineFormat() { return (flags_ & SINGLELINE_FORMAT) != 0; };
+  
   short getStatsReqType() { return statsReqType_; }
 
   // ---------------------------------------------------------------------
@@ -1846,7 +1850,8 @@ protected:
     DETAILED_STATS   = 0x0008,
     OLD_FORMAT       = 0x0010,
     SHORT_FORMAT     = 0x0020,
-    TOKENIZED_FORMAT = 0x0040
+    TOKENIZED_FORMAT = 0x0040,
+    SINGLELINE_FORMAT = 0x0100
   };
 
   NABasicPtr stmtName_;                                        // 00-07

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/executor/ExExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtil.h b/core/sql/executor/ExExeUtil.h
index ead2e42..541ac08 100755
--- a/core/sql/executor/ExExeUtil.h
+++ b/core/sql/executor/ExExeUtil.h
@@ -1549,6 +1549,7 @@ class ExExeUtilGetStatisticsTcb : public ExExeUtilTcb
 {
   friend class ExExeUtilGetStatisticsTdb;
   friend class ExExeUtilPrivateState;
+  friend class ExExeUtilGetRTSStatisticsTcb;
 
 public:
   // Constructor
@@ -1567,7 +1568,6 @@ public:
   {
     return (ExExeUtilGetStatisticsTdb &) tdb;
   };
-
  protected:
   void moveCompilationStatsToUpQueue(CompilationStatsData *cmpStats);
 
@@ -2219,6 +2219,7 @@ public:
   void initSqlStatsItems(SQLSTATS_ITEM *sqlStatsItem,
                                   ULng32  noOfStatsItem,
                                   NABoolean initTdbIdOnly);
+  NABoolean singleLineFormat() { return singleLineFormat_; } 
 
 private:
   enum Step
@@ -2320,6 +2321,7 @@ private:
   void formatWInt64(SQLSTATS_ITEM stat, char* targetString);
   char *formatTimestamp(char *buf, Int64 inTime);
   char *formatElapsedTime(char *buf, Int64 inTime);
+  NABoolean singleLineFormat_;
 };
 
 class ExExeUtilGetRTSStatisticsPrivateState : public ex_tcb_private_state

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/executor/ExExeUtilGetStats.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilGetStats.cpp b/core/sql/executor/ExExeUtilGetStats.cpp
index 696e1d9..396a0a6 100644
--- a/core/sql/executor/ExExeUtilGetStats.cpp
+++ b/core/sql/executor/ExExeUtilGetStats.cpp
@@ -1498,6 +1498,7 @@ ExExeUtilGetRTSStatisticsTcb::ExExeUtilGetRTSStatisticsTcb(
   maxReplicatorStatsItems_ = 0;
   maxHbaseStatsItems_ = 0;
   maxHiveStatsItems_ = 0;
+  singleLineFormat_ = ((ComTdbExeUtilGetStatistics &)exe_util_tdb).singleLineFormat();
 }
 
 ExExeUtilGetRTSStatisticsTcb::~ExExeUtilGetRTSStatisticsTcb()
@@ -2321,7 +2322,7 @@ short ExExeUtilGetRTSStatisticsTcb::work()
       {
         if (measStatsItems_ == NULL)
         {
-          maxMeasStatsItems_ = 27;
+          maxMeasStatsItems_ = 28;
           measStatsItems_ = new (getGlobals()->getDefaultHeap()) 
                   SQLSTATS_ITEM[maxMeasStatsItems_];
           initSqlStatsItems(measStatsItems_, maxMeasStatsItems_, FALSE);
@@ -2336,23 +2337,24 @@ short ExExeUtilGetRTSStatisticsTcb::work()
           measStatsItems_[8].statsItem_id = SQLSTATS_SQL_SPACE_USED;
           measStatsItems_[9].statsItem_id = SQLSTATS_SQL_HEAP_ALLOC;
           measStatsItems_[10].statsItem_id = SQLSTATS_SQL_HEAP_USED;
-          measStatsItems_[11].statsItem_id = SQLSTATS_OPENS;
-          measStatsItems_[12].statsItem_id = SQLSTATS_OPEN_TIME;
-          measStatsItems_[13].statsItem_id = SQLSTATS_PROCESS_CREATED;
-          measStatsItems_[14].statsItem_id = SQLSTATS_PROCESS_CREATE_TIME;
-          measStatsItems_[15].statsItem_id = SQLSTATS_REQ_MSG_CNT;
-          measStatsItems_[16].statsItem_id = SQLSTATS_REQ_MSG_BYTES;
-          measStatsItems_[17].statsItem_id = SQLSTATS_REPLY_MSG_CNT;
-          measStatsItems_[18].statsItem_id = SQLSTATS_REPLY_MSG_BYTES;
-          measStatsItems_[19].statsItem_id = SQLSTATS_SCRATCH_OVERFLOW_MODE;
-          measStatsItems_[20].statsItem_id = SQLSTATS_SCRATCH_FILE_COUNT;
-          measStatsItems_[21].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCK_SIZE;
-          measStatsItems_[22].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_READ;
-          measStatsItems_[23].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_WRITTEN;
-          measStatsItems_[24].statsItem_id = SQLSTATS_SCRATCH_READ_COUNT;
-          measStatsItems_[25].statsItem_id = SQLSTATS_SCRATCH_WRITE_COUNT;
-          measStatsItems_[26].statsItem_id = SQLSTATS_TOPN;
-          // maxMeasStatsItems_ is set to  27
+          measStatsItems_[11].statsItem_id = SQLSTATS_SQL_HEAP_WM;
+          measStatsItems_[12].statsItem_id = SQLSTATS_OPENS;
+          measStatsItems_[13].statsItem_id = SQLSTATS_OPEN_TIME;
+          measStatsItems_[14].statsItem_id = SQLSTATS_PROCESS_CREATED;
+          measStatsItems_[15].statsItem_id = SQLSTATS_PROCESS_CREATE_TIME;
+          measStatsItems_[16].statsItem_id = SQLSTATS_REQ_MSG_CNT;
+          measStatsItems_[17].statsItem_id = SQLSTATS_REQ_MSG_BYTES;
+          measStatsItems_[18].statsItem_id = SQLSTATS_REPLY_MSG_CNT;
+          measStatsItems_[19].statsItem_id = SQLSTATS_REPLY_MSG_BYTES;
+          measStatsItems_[20].statsItem_id = SQLSTATS_SCRATCH_OVERFLOW_MODE;
+          measStatsItems_[21].statsItem_id = SQLSTATS_SCRATCH_FILE_COUNT;
+          measStatsItems_[22].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCK_SIZE;
+          measStatsItems_[23].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_READ;
+          measStatsItems_[24].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_WRITTEN;
+          measStatsItems_[25].statsItem_id = SQLSTATS_SCRATCH_READ_COUNT;
+          measStatsItems_[26].statsItem_id = SQLSTATS_SCRATCH_WRITE_COUNT;
+          measStatsItems_[27].statsItem_id = SQLSTATS_TOPN;
+          // maxMeasStatsItems_ is set to  28
         }
         else
           initSqlStatsItems(measStatsItems_, maxMeasStatsItems_, TRUE);
@@ -2444,6 +2446,12 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             AddCommas(Int64Val,intSize); 
             str_sprintf(statsBuf_, "%25s%s KB", "SQL Heap Used", Int64Val);
             break;
+          case SQLSTATS_SQL_HEAP_WM:
+            str_sprintf(Int64Val, "%Ld", measStatsItems_[i].int64_value);
+            intSize = str_len(Int64Val);
+            AddCommas(Int64Val,intSize); 
+            str_sprintf(statsBuf_, "%25s%s KB", "SQL Heap WM", Int64Val);
+            break;
           case SQLSTATS_OPENS:
             str_sprintf(Int64Val, "%Ld", measStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
@@ -2552,7 +2560,7 @@ short ExExeUtilGetRTSStatisticsTcb::work()
       {
         if (rootOperStatsItems_ == NULL)
         {
-          maxRootOperStatsItems_ = 24;
+          maxRootOperStatsItems_ = 25;
           rootOperStatsItems_ = new (getGlobals()->getDefaultHeap()) 
                   SQLSTATS_ITEM[maxRootOperStatsItems_];
           initSqlStatsItems(rootOperStatsItems_, maxRootOperStatsItems_, FALSE);
@@ -2564,23 +2572,24 @@ short ExExeUtilGetRTSStatisticsTcb::work()
           rootOperStatsItems_[5].statsItem_id = SQLSTATS_SQL_SPACE_USED;
           rootOperStatsItems_[6].statsItem_id = SQLSTATS_SQL_HEAP_ALLOC;
           rootOperStatsItems_[7].statsItem_id = SQLSTATS_SQL_HEAP_USED;
-          rootOperStatsItems_[8].statsItem_id = SQLSTATS_OPENS;
-          rootOperStatsItems_[9].statsItem_id = SQLSTATS_OPEN_TIME;
-          rootOperStatsItems_[10].statsItem_id = SQLSTATS_PROCESS_CREATED;
-          rootOperStatsItems_[11].statsItem_id = SQLSTATS_PROCESS_CREATE_TIME;
-          rootOperStatsItems_[12].statsItem_id = SQLSTATS_REQ_MSG_CNT;
-          rootOperStatsItems_[13].statsItem_id = SQLSTATS_REQ_MSG_BYTES;
-          rootOperStatsItems_[14].statsItem_id = SQLSTATS_REPLY_MSG_CNT;
-          rootOperStatsItems_[15].statsItem_id = SQLSTATS_REPLY_MSG_BYTES;
-          rootOperStatsItems_[16].statsItem_id = SQLSTATS_SCRATCH_OVERFLOW_MODE;
-          rootOperStatsItems_[17].statsItem_id = SQLSTATS_SCRATCH_FILE_COUNT;
-          rootOperStatsItems_[18].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCK_SIZE;
-          rootOperStatsItems_[19].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_READ;
-          rootOperStatsItems_[20].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_WRITTEN;
-          rootOperStatsItems_[21].statsItem_id = SQLSTATS_SCRATCH_READ_COUNT;
-          rootOperStatsItems_[22].statsItem_id = SQLSTATS_SCRATCH_WRITE_COUNT;
-          rootOperStatsItems_[23].statsItem_id = SQLSTATS_TOPN;
-          // maxRootOperStatsItems_ is set to 24
+          rootOperStatsItems_[8].statsItem_id = SQLSTATS_SQL_HEAP_WM;
+          rootOperStatsItems_[9].statsItem_id = SQLSTATS_OPENS;
+          rootOperStatsItems_[10].statsItem_id = SQLSTATS_OPEN_TIME;
+          rootOperStatsItems_[11].statsItem_id = SQLSTATS_PROCESS_CREATED;
+          rootOperStatsItems_[12].statsItem_id = SQLSTATS_PROCESS_CREATE_TIME;
+          rootOperStatsItems_[13].statsItem_id = SQLSTATS_REQ_MSG_CNT;
+          rootOperStatsItems_[14].statsItem_id = SQLSTATS_REQ_MSG_BYTES;
+          rootOperStatsItems_[15].statsItem_id = SQLSTATS_REPLY_MSG_CNT;
+          rootOperStatsItems_[16].statsItem_id = SQLSTATS_REPLY_MSG_BYTES;
+          rootOperStatsItems_[17].statsItem_id = SQLSTATS_SCRATCH_OVERFLOW_MODE;
+          rootOperStatsItems_[18].statsItem_id = SQLSTATS_SCRATCH_FILE_COUNT;
+          rootOperStatsItems_[19].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCK_SIZE;
+          rootOperStatsItems_[20].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_READ;
+          rootOperStatsItems_[21].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_WRITTEN;
+          rootOperStatsItems_[22].statsItem_id = SQLSTATS_SCRATCH_READ_COUNT;
+          rootOperStatsItems_[23].statsItem_id = SQLSTATS_SCRATCH_WRITE_COUNT;
+          rootOperStatsItems_[24].statsItem_id = SQLSTATS_TOPN;
+          // maxRootOperStatsItems_ is set to 25
         }
         else
           initSqlStatsItems(rootOperStatsItems_, maxRootOperStatsItems_, TRUE);
@@ -2656,6 +2665,10 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             formatWInt64( rootOperStatsItems_[i], Int64Val);
             str_sprintf(statsBuf_, "%25s%s KB", "SQL Heap Used", Int64Val);
             break;
+          case SQLSTATS_SQL_HEAP_WM:
+            formatWInt64( rootOperStatsItems_[i], Int64Val);
+            str_sprintf(statsBuf_, "%25s%s KB", "SQL Heap WM", Int64Val);
+            break;
           case SQLSTATS_OPENS:
             formatWInt64( rootOperStatsItems_[i], Int64Val);
             str_sprintf(statsBuf_, "%25s%s", "Opens", Int64Val);
@@ -2710,7 +2723,7 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             if (statsMergeType != SQLCLI_PROGRESS_STATS)
             {
               formatWInt64( rootOperStatsItems_[i], Int64Val);
-              str_sprintf(statsBuf_, "%25s%s", "Scr File Count", Int64Val);
+              str_sprintf(statsBuf_, "%25s%s", "Scr. File Count", Int64Val);
             }
             else
               continue;
@@ -2770,200 +2783,30 @@ short ExExeUtilGetRTSStatisticsTcb::work()
         step_ = GET_NEXT_STATS_DESC_ENTRY_;
       }
       break;
-/*
-    case GET_PERTABLE_STATS_ENTRY_:
-      {
-        if (pertableStatsItems_ == NULL)
-        {
-          maxPertableStatsItems_ = 15;
-          pertableStatsItems_ = new (getGlobals()->getDefaultHeap()) 
-                  SQLSTATS_ITEM[maxPertableStatsItems_];
-          initSqlStatsItems(pertableStatsItems_, maxPertableStatsItems_, FALSE);
-          pertableStatsItems_[0].statsItem_id = SQLSTATS_TABLE_ANSI_NAME;
-          pertableStatsItems_[1].statsItem_id = SQLSTATS_EST_ROWS_ACCESSED;
-          pertableStatsItems_[2].statsItem_id = SQLSTATS_EST_ROWS_USED;
-          pertableStatsItems_[3].statsItem_id = SQLSTATS_ACT_ROWS_ACCESSED;
-          pertableStatsItems_[4].statsItem_id = SQLSTATS_ACT_ROWS_USED;
-          pertableStatsItems_[5].statsItem_id = SQLSTATS_DISK_IOS;
-          pertableStatsItems_[6].statsItem_id = SQLSTATS_MSG_COUNT;
-          pertableStatsItems_[7].statsItem_id = SQLSTATS_MSG_BYTES;
-          pertableStatsItems_[8].statsItem_id = SQLSTATS_STATS_BYTES;
-          pertableStatsItems_[9].statsItem_id = SQLSTATS_LOCK_ESCALATIONS;
-          pertableStatsItems_[10].statsItem_id = SQLSTATS_LOCK_WAITS;
-          pertableStatsItems_[11].statsItem_id = SQLSTATS_DP2_CPU_BUSY_TIME;
-          pertableStatsItems_[12].statsItem_id = SQLSTATS_OPENS;
-          pertableStatsItems_[13].statsItem_id = SQLSTATS_OPEN_TIME;
-          pertableStatsItems_[14].statsItem_id = SQLSTATS_DP2_REDRIVE_ATTEMPTS;
-          // maxPertableStatsItems_ is set to 14
-          // SQLSTATS_TABLE_ANSI_NAME
-          pertableStatsItems_[0].str_value = new (getGlobals()->getDefaultHeap())
-            char[ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES+1];
-          pertableStatsItems_[0].str_max_len = ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES;
-        }
-        else
-          initSqlStatsItems(pertableStatsItems_, maxPertableStatsItems_, TRUE);
-        cliRC = SQL_EXEC_GetStatisticsItems(getStatsTdb().statsReqType_,
-                getStatsTdb().stmtName_,
-                getStatsTdb().stmtName_ ? str_len(getStatsTdb().stmtName_) : 0,
-                maxPertableStatsItems_,
-                pertableStatsItems_);
-        if (cliRC < 0)
-        {
-          step_ = HANDLE_ERROR_;
-        }
-        else
-        {
-          if (! isHeadingDisplayed_)
-            step_ = DISPLAY_PERTABLE_STATS_HEADING_;
-          else
-            step_ = FORMAT_AND_RETURN_PERTABLE_STATS_;
-        }
-      }
-      break;
-    case DISPLAY_PERTABLE_STATS_HEADING_:
-      {
-        if ((qparent_.up->getSize() - qparent_.up->getLength()) < 5)
-	      return WORK_CALL_AGAIN;
-        moveRowToUpQueue(" ");
-        str_sprintf(statsBuf_, "%15s", "Table Name");
-	moveRowToUpQueue(statsBuf_);
-        str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-8s%-8s%-19s%-8s%-19s%-13s",
-		"Records Accessed", "Records Used", "Disk", "Message", "Message", "Lock", "Lock","Disk Process","Open", "Open",
-                "ReDrive");
-        moveRowToUpQueue(statsBuf_);
-	str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-8s%-8s%-19s%-8s%-19s%-13s",
-		"Estimated/Actual", "Estimated/Actual", "I/Os", "Count", "Bytes", "Escl","wait", "Busy Time",   "Count","Time",
-                "Attempts");
-        moveRowToUpQueue(statsBuf_);
-        isHeadingDisplayed_ = TRUE;
-        step_ = FORMAT_AND_RETURN_PERTABLE_STATS_;
-      }
-      break;
-    case FORMAT_AND_RETURN_PERTABLE_STATS_:
-      {
-        for (; currStatsItemEntry_ < maxPertableStatsItems_; currStatsItemEntry_++)
-        {
-          i = (short)currStatsItemEntry_;
-          if (pertableStatsItems_[i].error_code != 0)
-            continue;
-          switch (pertableStatsItems_[i].statsItem_id)
-          {
-          case SQLSTATS_TABLE_ANSI_NAME:
-            pertableStatsItems_[i].str_value[pertableStatsItems_[i].str_ret_len] = '\0';
-            str_sprintf(statsBuf_, "%s", pertableStatsItems_[i].str_value);
-            if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
-              return rc;
-            break;
-          case SQLSTATS_EST_ROWS_ACCESSED:
-            FormatFloat(formattedFloatVal, intSize, valSize, pertableStatsItems_[i].double_value,
-			FALSE, TRUE);
-            str_sprintf(statsBuf_, "%-19s", formattedFloatVal);
-            break;
-          case SQLSTATS_EST_ROWS_USED:
-            FormatFloat(formattedFloatVal, intSize, valSize, pertableStatsItems_[i].double_value,
-			FALSE, TRUE);
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", formattedFloatVal);
-            if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
-              return rc;
-            break;
-          case SQLSTATS_ACT_ROWS_ACCESSED:
-            str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(statsBuf_, "%-19s", Int64Val);
-            break;          
-          case SQLSTATS_ACT_ROWS_USED:
-            str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
-            break;
-          case SQLSTATS_DISK_IOS:
-           str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-13s", Int64Val);
-            break;
-          case SQLSTATS_MSG_COUNT:
-            str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-13s", Int64Val);
-            break;
-          case SQLSTATS_MSG_BYTES:
-            str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s",Int64Val);
-            break;
-          case SQLSTATS_LOCK_ESCALATIONS:
-            str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-8s",Int64Val);
-            break;
-          case SQLSTATS_LOCK_WAITS:
-           str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-8s",Int64Val);
-            break;
-          case SQLSTATS_DP2_CPU_BUSY_TIME:
-            str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
-            break;
-          case SQLSTATS_OPENS:
-           str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-8s",Int64Val);
-            break;
-          case SQLSTATS_OPEN_TIME:
-            str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
-            break;
-          case SQLSTATS_DP2_REDRIVE_ATTEMPTS:
-            str_sprintf(Int64Val, "%Ld", pertableStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-13s", Int64Val);
-            break;
-          default:
-            break;
-          }
-        }
-        if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
-          return rc;
-        step_ = GET_NEXT_STATS_DESC_ENTRY_;
-      }
-      break;
-*/
     case GET_HBASE_STATS_ENTRY_:
       {
         if (hbaseStatsItems_ == NULL)
         {
-          maxHbaseStatsItems_ = 9;
+          maxHbaseStatsItems_ = 11;
           hbaseStatsItems_ = new (getGlobals()->getDefaultHeap()) 
                   SQLSTATS_ITEM[maxHbaseStatsItems_];
           initSqlStatsItems(hbaseStatsItems_, maxHbaseStatsItems_, FALSE);
-          hbaseStatsItems_[0].statsItem_id = SQLSTATS_TABLE_ANSI_NAME;
-          hbaseStatsItems_[1].statsItem_id = SQLSTATS_EST_ROWS_ACCESSED;
-          hbaseStatsItems_[2].statsItem_id = SQLSTATS_EST_ROWS_USED;
-          hbaseStatsItems_[3].statsItem_id = SQLSTATS_ACT_ROWS_ACCESSED;
-          hbaseStatsItems_[4].statsItem_id = SQLSTATS_ACT_ROWS_USED;
-          hbaseStatsItems_[5].statsItem_id = SQLSTATS_HBASE_IOS;
-          hbaseStatsItems_[6].statsItem_id = SQLSTATS_HBASE_IO_BYTES;
-          hbaseStatsItems_[7].statsItem_id = SQLSTATS_HBASE_IO_ELAPSED_TIME;
-          hbaseStatsItems_[8].statsItem_id = SQLSTATS_HBASE_IO_MAX_TIME;
-          // maxHbaseStatsItems_ is set to 9
-          // SQLSTATS_TABLE_ANSI_NAME
-          hbaseStatsItems_[0].str_value = new (getGlobals()->getDefaultHeap())
+          hbaseStatsItems_[0].statsItem_id = SQLSTATS_TDB_ID;
+          hbaseStatsItems_[1].statsItem_id = SQLSTATS_DOP;
+          hbaseStatsItems_[2].statsItem_id = SQLSTATS_TABLE_ANSI_NAME;
+          hbaseStatsItems_[3].statsItem_id = SQLSTATS_EST_ROWS_ACCESSED;
+          hbaseStatsItems_[4].statsItem_id = SQLSTATS_EST_ROWS_USED;
+          hbaseStatsItems_[5].statsItem_id = SQLSTATS_ACT_ROWS_ACCESSED;
+          hbaseStatsItems_[6].statsItem_id = SQLSTATS_ACT_ROWS_USED;
+          hbaseStatsItems_[7].statsItem_id = SQLSTATS_HBASE_IOS;
+          hbaseStatsItems_[8].statsItem_id = SQLSTATS_HBASE_IO_BYTES;
+          hbaseStatsItems_[9].statsItem_id = SQLSTATS_HBASE_IO_ELAPSED_TIME;
+          hbaseStatsItems_[10].statsItem_id = SQLSTATS_HBASE_IO_MAX_TIME;
+          // maxHbaseStatsItems_ is set to 11
+          // SQLSTATS_TABLE_ANSI_NAM
+          hbaseStatsItems_[2].str_value = new (getGlobals()->getDefaultHeap())
             char[ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES+1];
-          hbaseStatsItems_[0].str_max_len = ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES;
+          hbaseStatsItems_[2].str_max_len = ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES;
         }
         else
           initSqlStatsItems(hbaseStatsItems_, maxHbaseStatsItems_, TRUE);
@@ -2990,22 +2833,33 @@ short ExExeUtilGetRTSStatisticsTcb::work()
         if ((qparent_.up->getSize() - qparent_.up->getLength()) < 5)
 	      return WORK_CALL_AGAIN;
         moveRowToUpQueue(" ");
-        str_sprintf(statsBuf_, "%15s", "Table Name");
-	moveRowToUpQueue(statsBuf_);
-        str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-19s",
+        if (singleLineFormat_) {
+           str_sprintf(statsBuf_, "%-9s%-10s%-19s%-19s%-19s%-19s%-13s%-13s%-19s%-19s%-10s",
+                "ID", "DOP",
+		"Est.Rows Accessed", "Est.Records Used",  "Act.Rows Accessed", "Act.Rows Used", "SE IOs", 
+                "SE IO Bytes", "SE IO Sum Time", "SE IO Max Time", "TableName");
+           moveRowToUpQueue(statsBuf_);
+        }
+        else {
+           str_sprintf(statsBuf_, "%-9s%-10s%-19s", 
+                "ID", "DOP","Table Name");
+	   moveRowToUpQueue(statsBuf_);
+           str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-19s",
 		"Records Accessed", "Records Used", "HBase/Hive", "HBase/Hive", 
                 "HBase/Hive IO", "HBase/Hive IO");
-        moveRowToUpQueue(statsBuf_);
-	str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-19s",
+           moveRowToUpQueue(statsBuf_);
+	   str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-19s",
 		"Estimated/Actual", "Estimated/Actual", "IOs", "IO MBytes",
                 "Sum Time", "Max Time");
-        moveRowToUpQueue(statsBuf_);
+           moveRowToUpQueue(statsBuf_);
+        }
         isHeadingDisplayed_ = TRUE;
         step_ = FORMAT_AND_RETURN_HBASE_STATS_;
       }
       break;
     case FORMAT_AND_RETURN_HBASE_STATS_:
       {
+        short tableNameIndex = 2;
         for (; currStatsItemEntry_ < maxHbaseStatsItems_; currStatsItemEntry_++)
         {
           i = (short)currStatsItemEntry_;
@@ -3013,29 +2867,47 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             continue;
           switch (hbaseStatsItems_[i].statsItem_id)
           {
+          case SQLSTATS_TDB_ID:
+            str_sprintf(statsBuf_, "%-9Ld", hbaseStatsItems_[i].int64_value);
+            break;
+          case SQLSTATS_DOP:
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-10Ld", hbaseStatsItems_[i].int64_value);
+            break;
           case SQLSTATS_TABLE_ANSI_NAME:
             hbaseStatsItems_[i].str_value[hbaseStatsItems_[i].str_ret_len] = '\0';
-            str_sprintf(statsBuf_, "%s", hbaseStatsItems_[i].str_value);
-            if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
-              return rc;
+            if (singleLineFormat_)
+               tableNameIndex = i;
+            else {
+               str_sprintf(&statsBuf_[strlen(statsBuf_)], "   %s", hbaseStatsItems_[i].str_value);
+               if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
+                  return rc;
+            }
             break;
           case SQLSTATS_EST_ROWS_ACCESSED:
             FormatFloat(formattedFloatVal, intSize, valSize, hbaseStatsItems_[i].double_value,
 			FALSE, TRUE);
-            str_sprintf(statsBuf_, "%-19s", formattedFloatVal);
+            if (singleLineFormat_)
+               str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", formattedFloatVal);
+            else
+               str_sprintf(statsBuf_, "%-19s", formattedFloatVal);
             break;
           case SQLSTATS_EST_ROWS_USED:
             FormatFloat(formattedFloatVal, intSize, valSize, hbaseStatsItems_[i].double_value,
 			FALSE, TRUE);
             str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", formattedFloatVal);
-            if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
-              return rc;
+            if (! singleLineFormat_) {
+               if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
+                  return rc;
+            }
             break;
           case SQLSTATS_ACT_ROWS_ACCESSED:
             str_sprintf(Int64Val, "%Ld", hbaseStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
-            str_sprintf(statsBuf_, "%-19s", Int64Val);
+            if (singleLineFormat_)
+               str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
+            else
+               str_sprintf(statsBuf_, "%-19s", Int64Val);
             break;          
           case SQLSTATS_ACT_ROWS_USED:
             str_sprintf(Int64Val, "%Ld", hbaseStatsItems_[i].int64_value);
@@ -3071,6 +2943,8 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             break;
           }
         }
+        if (singleLineFormat_)
+           str_sprintf(&statsBuf_[strlen(statsBuf_)], " %s", hbaseStatsItems_[2].str_value);
         if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
           return rc;
         step_ = GET_NEXT_STATS_DESC_ENTRY_;
@@ -3080,24 +2954,26 @@ short ExExeUtilGetRTSStatisticsTcb::work()
       {
         if (hiveStatsItems_ == NULL)
         {
-          maxHiveStatsItems_ = 9;
+          maxHiveStatsItems_ = 11;
           hiveStatsItems_ = new (getGlobals()->getDefaultHeap()) 
                   SQLSTATS_ITEM[maxHiveStatsItems_];
           initSqlStatsItems(hiveStatsItems_, maxHiveStatsItems_, FALSE);
-          hiveStatsItems_[0].statsItem_id = SQLSTATS_TABLE_ANSI_NAME;
-          hiveStatsItems_[1].statsItem_id = SQLSTATS_EST_ROWS_ACCESSED;
-          hiveStatsItems_[2].statsItem_id = SQLSTATS_EST_ROWS_USED;
-          hiveStatsItems_[3].statsItem_id = SQLSTATS_ACT_ROWS_ACCESSED;
-          hiveStatsItems_[4].statsItem_id = SQLSTATS_ACT_ROWS_USED;
-          hiveStatsItems_[5].statsItem_id = SQLSTATS_HIVE_IOS;
-          hiveStatsItems_[6].statsItem_id = SQLSTATS_HIVE_IO_BYTES;
-          hiveStatsItems_[7].statsItem_id = SQLSTATS_HIVE_IO_ELAPSED_TIME;
-          hiveStatsItems_[8].statsItem_id = SQLSTATS_HIVE_IO_MAX_TIME;
-          // maxHiveStatsItems_ is set to 9
+          hiveStatsItems_[0].statsItem_id = SQLSTATS_TDB_ID;
+          hiveStatsItems_[1].statsItem_id = SQLSTATS_DOP;
+          hiveStatsItems_[2].statsItem_id = SQLSTATS_TABLE_ANSI_NAME;
+          hiveStatsItems_[3].statsItem_id = SQLSTATS_EST_ROWS_ACCESSED;
+          hiveStatsItems_[4].statsItem_id = SQLSTATS_EST_ROWS_USED;
+          hiveStatsItems_[5].statsItem_id = SQLSTATS_ACT_ROWS_ACCESSED;
+          hiveStatsItems_[6].statsItem_id = SQLSTATS_ACT_ROWS_USED;
+          hiveStatsItems_[7].statsItem_id = SQLSTATS_HIVE_IOS;
+          hiveStatsItems_[8].statsItem_id = SQLSTATS_HIVE_IO_BYTES;
+          hiveStatsItems_[9].statsItem_id = SQLSTATS_HIVE_IO_ELAPSED_TIME;
+          hiveStatsItems_[10].statsItem_id = SQLSTATS_HIVE_IO_MAX_TIME;
+          // maxHiveStatsItems_ is set to 11 
           // SQLSTATS_TABLE_ANSI_NAME
-          hiveStatsItems_[0].str_value = new (getGlobals()->getDefaultHeap())
+          hiveStatsItems_[2].str_value = new (getGlobals()->getDefaultHeap())
             char[ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES+1];
-          hiveStatsItems_[0].str_max_len = ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES;
+          hiveStatsItems_[2].str_max_len = ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES;
         }
         else
           initSqlStatsItems(hiveStatsItems_, maxHiveStatsItems_, TRUE);
@@ -3124,22 +3000,32 @@ short ExExeUtilGetRTSStatisticsTcb::work()
         if ((qparent_.up->getSize() - qparent_.up->getLength()) < 5)
 	      return WORK_CALL_AGAIN;
         moveRowToUpQueue(" ");
-        str_sprintf(statsBuf_, "%15s", "Table Name");
-	moveRowToUpQueue(statsBuf_);
-        str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-19s",
+        if (singleLineFormat_) {
+           str_sprintf(statsBuf_, "%-9s%-10s%-19s%-19s%-19s%-19s%-13s%-13s%-19s%-19s%-10s",
+                "ID", "DOP",
+		"Est.Rows Accessed", "Est.Records Used",  "Act.Rows Accessed", "Act.Rows Used", "SE IOs", 
+                "SE IO Bytes", "SE IO Sum Time", "SE IO Max Time", "TableName");
+           moveRowToUpQueue(statsBuf_);
+        }
+        else {
+           str_sprintf(statsBuf_, "%-9s%-10s%-19s", "ID", "DOP","Table Name");
+	   moveRowToUpQueue(statsBuf_);
+           str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-19s",
 		"Records Accessed", "Records Used", "HBase/Hive", "HBase/Hive", 
                 "HBase/Hive IO", "HBase/Hive IO");
-        moveRowToUpQueue(statsBuf_);
-	str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-19s",
+           moveRowToUpQueue(statsBuf_);
+	   str_sprintf(statsBuf_, "%-19s%-19s%-13s%-13s%-19s%-19s",
 		"Estimated/Actual", "Estimated/Actual", "IOs", "IO MBytes",
                 "Sum Time", "Max Time");
-        moveRowToUpQueue(statsBuf_);
+           moveRowToUpQueue(statsBuf_);
+        }
         isHeadingDisplayed_ = TRUE;
         step_ = FORMAT_AND_RETURN_HIVE_STATS_;
       }
       break;
     case FORMAT_AND_RETURN_HIVE_STATS_:
       {
+        short tableNameIndex = 2;
         for (; currStatsItemEntry_ < maxHiveStatsItems_; currStatsItemEntry_++)
         {
           i = (short)currStatsItemEntry_;
@@ -3147,16 +3033,29 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             continue;
           switch (hiveStatsItems_[i].statsItem_id)
           {
+          case SQLSTATS_TDB_ID:
+            str_sprintf(statsBuf_, "%-9Ld", hiveStatsItems_[i].int64_value);
+            break;
+          case SQLSTATS_DOP:
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-10Ld", hiveStatsItems_[i].int64_value);
+            break;
           case SQLSTATS_TABLE_ANSI_NAME:
             hiveStatsItems_[i].str_value[hiveStatsItems_[i].str_ret_len] = '\0';
-            str_sprintf(statsBuf_, "%s", hiveStatsItems_[i].str_value);
-            if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
-              return rc;
+            if (singleLineFormat_)
+               tableNameIndex = i;
+            else {
+               str_sprintf(&statsBuf_[strlen(statsBuf_)], "   %s", hiveStatsItems_[i].str_value);
+               if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
+                  return rc;
+            }
             break;
           case SQLSTATS_EST_ROWS_ACCESSED:
             FormatFloat(formattedFloatVal, intSize, valSize, hiveStatsItems_[i].double_value,
 			FALSE, TRUE);
-            str_sprintf(statsBuf_, "%-19s", formattedFloatVal);
+            if (singleLineFormat_)
+               str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", formattedFloatVal);
+            else
+               str_sprintf(statsBuf_, "%-19s", formattedFloatVal);
             break;
           case SQLSTATS_EST_ROWS_USED:
             FormatFloat(formattedFloatVal, intSize, valSize, hiveStatsItems_[i].double_value,
@@ -3169,7 +3068,10 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             str_sprintf(Int64Val, "%Ld", hiveStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
-            str_sprintf(statsBuf_, "%-19s", Int64Val);
+            if (singleLineFormat_)
+               str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
+            else
+               str_sprintf(statsBuf_, "%-19s", Int64Val);
             break;          
           case SQLSTATS_ACT_ROWS_USED:
             str_sprintf(Int64Val, "%Ld", hiveStatsItems_[i].int64_value);
@@ -3205,6 +3107,8 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             break;
           }
         }
+        if (singleLineFormat_)
+           str_sprintf(&statsBuf_[strlen(statsBuf_)], " %s", hiveStatsItems_[2].str_value);
         if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
           return rc;
         step_ = GET_NEXT_STATS_DESC_ENTRY_;
@@ -3214,38 +3118,37 @@ short ExExeUtilGetRTSStatisticsTcb::work()
       {
         if (bmoStatsItems_ == NULL)
         {
-          maxBMOStatsItems_ = 16;
+          maxBMOStatsItems_ = 18;
           bmoStatsItems_ = new (getGlobals()->getDefaultHeap()) 
                   SQLSTATS_ITEM[maxBMOStatsItems_];
           initSqlStatsItems(bmoStatsItems_, maxBMOStatsItems_, FALSE);
           bmoStatsItems_[0].statsItem_id = SQLSTATS_TDB_ID;
           bmoStatsItems_[1].statsItem_id = SQLSTATS_TDB_NAME;
           bmoStatsItems_[2].statsItem_id = SQLSTATS_SCRATCH_OVERFLOW_MODE;
-          bmoStatsItems_[3].statsItem_id = SQLSTATS_TOPN;
-          //bmoStatsItems_[3].statsItem_id = SQLSTATS_OVERFLOW_PHASE;
-          //bmoStatsItems_[4].statsItem_id = SQLSTATS_OVEFLOW_PHASE_STARTTIME;
-          bmoStatsItems_[4].statsItem_id = SQLSTATS_OPER_CPU_TIME;
-          bmoStatsItems_[5].statsItem_id = SQLSTATS_SCRATCH_FILE_COUNT;
-          bmoStatsItems_[6].statsItem_id = SQLSTATS_BMO_HEAP_USED;
-          bmoStatsItems_[7].statsItem_id = SQLSTATS_BMO_HEAP_ALLOC;
-          bmoStatsItems_[8].statsItem_id = SQLSTATS_BMO_HEAP_WM;
-          bmoStatsItems_[9].statsItem_id = SQLSTATS_BMO_SPACE_BUFFER_SIZE;
-          bmoStatsItems_[10].statsItem_id = SQLSTATS_BMO_SPACE_BUFFER_COUNT;
-          bmoStatsItems_[11].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCK_SIZE;
-          bmoStatsItems_[12].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_READ;
-          bmoStatsItems_[13].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_WRITTEN;
-          bmoStatsItems_[14].statsItem_id = SQLSTATS_SCRATCH_READ_COUNT;
-          bmoStatsItems_[15].statsItem_id = SQLSTATS_SCRATCH_WRITE_COUNT;
-          
-          // maxBMOStatsItems_ is set to 16
+          bmoStatsItems_[3].statsItem_id = SQLSTATS_DOP;
+          bmoStatsItems_[4].statsItem_id = SQLSTATS_TOPN;
+          bmoStatsItems_[5].statsItem_id = SQLSTATS_OPER_CPU_TIME;
+          bmoStatsItems_[6].statsItem_id = SQLSTATS_SCRATCH_FILE_COUNT;
+          bmoStatsItems_[7].statsItem_id = SQLSTATS_BMO_HEAP_USED;
+          bmoStatsItems_[8].statsItem_id = SQLSTATS_BMO_HEAP_ALLOC;
+          bmoStatsItems_[9].statsItem_id = SQLSTATS_BMO_HEAP_WM;
+          bmoStatsItems_[10].statsItem_id = SQLSTATS_BMO_SPACE_BUFFER_SIZE;
+          bmoStatsItems_[11].statsItem_id = SQLSTATS_BMO_SPACE_BUFFER_COUNT;
+          bmoStatsItems_[12].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCK_SIZE;
+          bmoStatsItems_[13].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_READ;
+          bmoStatsItems_[14].statsItem_id = SQLSTATS_SCRATCH_BUFFER_BLOCKS_WRITTEN;
+          bmoStatsItems_[15].statsItem_id = SQLSTATS_SCRATCH_READ_COUNT;
+          bmoStatsItems_[16].statsItem_id = SQLSTATS_SCRATCH_WRITE_COUNT;
+          bmoStatsItems_[17].statsItem_id = SQLSTATS_SCRATCH_IO_TIME;
+          // maxBMOStatsItems_ is set to 18
           // TDB_NAME
           bmoStatsItems_[1].str_value = new (getGlobals()->getDefaultHeap())
                       char[MAX_TDB_NAME_LEN+1];
           bmoStatsItems_[1].str_max_len = MAX_TDB_NAME_LEN;
-          // OVERFLOW_PHASE
-          bmoStatsItems_[3].str_value = new (getGlobals()->getDefaultHeap())
+          // OVERFLOW_MODE
+          bmoStatsItems_[2].str_value = new (getGlobals()->getDefaultHeap())
                       char[13];
-          bmoStatsItems_[3].str_max_len = 12;
+          bmoStatsItems_[2].str_max_len = 12;
         }
         else
           initSqlStatsItems(bmoStatsItems_, maxBMOStatsItems_, TRUE);
@@ -3270,24 +3173,32 @@ short ExExeUtilGetRTSStatisticsTcb::work()
       break;
     case DISPLAY_BMO_STATS_HEADING_:
       {
-        if ((qparent_.up->getSize() - qparent_.up->getLength()) < 4)
+       if ((qparent_.up->getSize() - qparent_.up->getLength()) < 4)
 	      return WORK_CALL_AGAIN;
-        moveRowToUpQueue(" ");
-              
-        str_sprintf(statsBuf_, "%-5s%-17s%-20s%-20s%-20s%-20s%",
-            "Id", "TDB Name", "Mode", "TopN", "CPU Time","File Count");
-        moveRowToUpQueue(statsBuf_);
+       moveRowToUpQueue(" ");
+       if (singleLineFormat()) {       
+          str_sprintf(statsBuf_, "%-5s%-19s%-19s%-10s%-9s%-20s%-20s%-24s%-19s%-19s%-20s%-20s%-5s%-19s%-19s%-19s%-20s%-20s",
+               "Id", "TDB Name", "Mode", "DOP", "TopN", "CPU Time","File Count",
+                "BMO Heap Used", "BMO Heap Total", "BMO Heap WM",
+                "BMO Space BufSz","BMO Space BufCnt", "Size",
+                "ScrBlk Read", "ScrBlk Written", "ScrIO Read", "ScrIO Written", "ScrIO Time");
+          moveRowToUpQueue(statsBuf_);
+       }
+       else {
+          str_sprintf(statsBuf_, "%-5s%-19s%-19s%-10s%-9s%-20s%-20s",
+               "Id", "TDB Name", "Mode", "DOP", "TopN", "CPU Time","File Count");
+          moveRowToUpQueue(statsBuf_);
         
-       str_sprintf(statsBuf_, "%-22s%-20s%-20s%-20s%-20s%",
+          str_sprintf(statsBuf_, "%-24s%-19s%-19s%-20s%-20s",
                 "BMO Heap Used", "BMO Heap Total", "BMO Heap WM",
                 "BMO Space BufSz","BMO Space BufCnt");
-       moveRowToUpQueue(statsBuf_);
+          moveRowToUpQueue(statsBuf_);
        
-       str_sprintf(statsBuf_, "%-22s%-20s%-20s%-20s%-20s%",
-                "ScrBlk Size",
-                "ScrBlk Read", "ScrBlk Written", "ScrIO Read", "ScrIO Written");
-  
-        moveRowToUpQueue(statsBuf_);
+          str_sprintf(statsBuf_, "%-5s%-19s%-19s%-19s%-20s%-20s",
+                "Size",
+                "ScrBlk Read", "ScrBlk Written", "ScrIO Read", "ScrIO Written", "ScrIO Time");
+          moveRowToUpQueue(statsBuf_);
+        }
         isBMOHeadingDisplayed_ = TRUE;
         step_ = FORMAT_AND_RETURN_BMO_STATS_;
       }
@@ -3306,17 +3217,20 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             break;
           case SQLSTATS_TDB_NAME:
             bmoStatsItems_[i].str_value[bmoStatsItems_[i].str_ret_len] = '\0';
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-17s", bmoStatsItems_[i].str_value);
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", bmoStatsItems_[i].str_value);
             break;
           case SQLSTATS_SCRATCH_OVERFLOW_MODE:
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", 
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", 
                  ExBMOStats::getScratchOverflowMode((Int16) bmoStatsItems_[i].int64_value));
             break;
+          case SQLSTATS_DOP:
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-10Ld", bmoStatsItems_[i].int64_value);
+            break;
           case SQLSTATS_TOPN:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-9s", Int64Val);
             break;
           case SQLSTATS_OPER_CPU_TIME:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
@@ -3329,41 +3243,26 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
             str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
-            if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
-              return rc;
-            break;
-/*
-          case SQLSTATS_OVERFLOW_PHASE:
-            bmoStatsItems_[i].str_value[bmoStatsItems_[i].str_ret_len] = '\0';
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%12s", bmoStatsItems_[i].str_value);
-            break;
-          case SQLSTATS_OVEFLOW_PHASE_STARTTIME:
-            if (bmoStatsItems_[i].int64_value == -1)
-            {
-              str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-21s", " ");
-            }
-            else
-            {
-	      jtime = CONVERTTIMESTAMP(bmoStatsItems_[i].int64_value,0,-1,NULL);
-	      INTERPRETTIMESTAMP(jtime, timestamp);
-	      str_sprintf(&statsBuf_[strlen(statsBuf_)], "%04d/%02d/%02d %02d:%02d:%02d",
-                          timestamp[0], timestamp[1], timestamp[2],
-			  timestamp[3], timestamp[4], timestamp[5]);
+            if (! singleLineFormat_) {
+               if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
+                  return rc;
             }
             break;
-*/
           case SQLSTATS_BMO_HEAP_USED:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
-            str_sprintf(statsBuf_, "%-22s", Int64Val);
+            if (singleLineFormat_) 
+               str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-24s", Int64Val);
+            else
+               str_sprintf(statsBuf_, "%-24s", Int64Val);
             break;
           case SQLSTATS_BMO_HEAP_ALLOC:
           case SQLSTATS_BMO_HEAP_WM:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
             break;
           case SQLSTATS_BMO_SPACE_BUFFER_SIZE:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
@@ -3376,38 +3275,47 @@ short ExExeUtilGetRTSStatisticsTcb::work()
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
             str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
-            if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
-              return rc;
+            if (! singleLineFormat_) {
+               if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
+                  return rc;
+            }
             break;
           case SQLSTATS_SCRATCH_BUFFER_BLOCK_SIZE:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
-            intSize = str_len(Int64Val);
-            AddCommas(Int64Val,intSize); 
-            str_sprintf(statsBuf_, "%-22s", Int64Val);
+            if (singleLineFormat_) 
+               str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-5s", Int64Val);
+            else
+               str_sprintf(statsBuf_, "%-5s", Int64Val);
             break;
           case SQLSTATS_SCRATCH_BUFFER_BLOCKS_READ:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
             break;
           case SQLSTATS_SCRATCH_BUFFER_BLOCKS_WRITTEN:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
             break;
           case SQLSTATS_SCRATCH_READ_COUNT:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
-            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-19s", Int64Val);
             break;
           case SQLSTATS_SCRATCH_WRITE_COUNT:
             str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
             intSize = str_len(Int64Val);
             AddCommas(Int64Val,intSize); 
             str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
+            break;
+          case SQLSTATS_SCRATCH_IO_TIME:
+            str_sprintf(Int64Val, "%Ld", bmoStatsItems_[i].int64_value);
+            intSize = str_len(Int64Val);
+            AddCommas(Int64Val,intSize); 
+            str_sprintf(&statsBuf_[strlen(statsBuf_)], "%-20s", Int64Val);
             if (moveRowToUpQueue(statsBuf_, strlen(statsBuf_), &rc) == -1)
               return rc;
             break;


[3/6] incubator-trafodion git commit: [TRAFODION-2420] RMS enhancements Introduced 2 new counters HeapWM: - "SQL Heap WM" - Tracks the high water mark of the used memory including space buffer and bmo operator memory. It is enough to moni

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/executor/ExStats.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExStats.cpp b/core/sql/executor/ExStats.cpp
index 03e41e2..6c78538 100644
--- a/core/sql/executor/ExStats.cpp
+++ b/core/sql/executor/ExStats.cpp
@@ -41,7 +41,6 @@
 
   #define FAILURE { ex_assert(FALSE, "Invalid SqlBuffer"); }
 
-#ifndef __EID
 #include <stdio.h>
 
 #include "NAStdlib.h"
@@ -50,7 +49,6 @@
 #include "cli_stdh.h"
 #include "sql_id.h"
 #include "Statement.h"
-#endif /* __EID */
 
 #include <float.h>
 
@@ -70,14 +68,12 @@
 #include "ComQueue.h"
 #include "ExStats.h"
 #include "str.h"
-#ifndef __EID
 #include "ssmpipc.h"
 #include "rts_msg.h"
 #include "ComSqlId.h"
 #include "ComRtUtils.h"
 #include "Statement.h"
 #include "ComTdbRoot.h"
-#endif
 #include "ComDistribution.h"
 
 #include <unistd.h>
@@ -210,21 +206,17 @@ void ExStatsCounter::init()
 float ExStatsCounter::mean()
 {
   float result = 0.0;
-#ifndef __EID
   if (entryCnt_)
     result = ((float) sum_) / (float)entryCnt_;
-#endif
   return result;
 }
 
 float ExStatsCounter::variance()
 {
   float result = 0.0;
-#ifndef __EID
   if (entryCnt_ > 1)
     result = (1.0F/(float)(entryCnt_ - 1)) *
       (sum2_ - (1.0F/(float)entryCnt_) * (float)sum_ * (float)sum_);
-#endif
   return result;
 }
 
@@ -726,13 +718,8 @@ ExOperStats::ExOperStats(NAMemory * heap,
     collectStatsType_ = (UInt16)((ComTdb*)tdb)->getCollectStatsType();
     incDop();
   }
-#ifndef __EID
   sprintf(processNameString_, "%03d,%05d", GetCliGlobals()->myCpu(),
                                  GetCliGlobals()->myPin());
-#else
-  processNameString_[0] = '\0';
-#endif 
-  
   allStats.downQueueSize_ = 0;
   allStats.upQueueSize_ = 0;
   allStats.ntProcessId_ = -1;
@@ -847,13 +834,8 @@ ExOperStats::ExOperStats(NAMemory *heap,
   id_.tdbId_      = tdbId;
   id_.instNum_    = instNum;
   id_.subInstNum_ = 0; 
-#ifndef __EID
   sprintf(processNameString_, "%03d,%05d", GetCliGlobals()->myCpu(),
                                  GetCliGlobals()->myPin());
-#else
-  processNameString_[0] = '\0';
-#endif 
-
   str_cpy_all(tdbName_, tdbName, tdbNameLen);
   tdbName_[tdbNameLen] = 0;
   tdbType_ = tdbType;
@@ -1283,7 +1265,6 @@ void ExOperStats::getVariableStatsInfo(char * dataBuffer,
   *(short*)dataLen = (short) (buf - dataBuffer);
 }
 
-#ifndef __EID
 // sets sqlStats_item->error_code
 //   0 if stats_item is found OK
 //   EXE_ERROR_IN_STAT_ITEM if stats_item is found but is truncated
@@ -1378,8 +1359,6 @@ Lng32 ExOperStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
 
   return 0;
 }
-#endif
-
 
 NABoolean ExOperStats::operator==(ExOperStats * other) 
 {
@@ -1461,15 +1440,11 @@ ExFragRootOperStats::ExFragRootOperStats(NAMemory * heap,
 		tdb),
     flags_(0)
 {
-#ifndef __EID
   executionCount_ = 0;
-#endif
   init();
   initHistory();
-#ifndef __EID
   queryId_ = NULL;
   queryIdLen_ = 0;
-#endif
   restoreDop();
 
   if (tdb && tcb && tcb->getGlobals())
@@ -1489,17 +1464,13 @@ ExFragRootOperStats::ExFragRootOperStats(NAMemory * heap)
 		ROOT_OPER_STATS),
     flags_(0)
 {
-#ifndef __EID
   executionCount_ = 0;
-#endif
   init();
   initHistory();
-#ifndef __EID
   queryId_ = NULL;
   queryIdLen_ = 0;
   stmtIndex_ = -1;
   timestamp_ = 0;
-#endif
   restoreDop();
 }
 
@@ -1520,18 +1491,15 @@ ExFragRootOperStats::ExFragRootOperStats(NAMemory *heap,
    // Set the Id so that 
   init();
   initHistory();
-#ifndef __EID
   queryId_ = NULL;
   queryIdLen_ = 0;
   stmtIndex_ = -1;
   timestamp_ = 0;
-#endif
   restoreDop();
 }
 
 ExFragRootOperStats::~ExFragRootOperStats()
 {
-#ifndef __EID
   ExProcessStats *processStats;
 
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS && queryId_ != NULL)
@@ -1546,24 +1514,24 @@ ExFragRootOperStats::~ExFragRootOperStats()
     if (processStats != NULL)
        processStats->setRecentQidToNull(queryId_);
   }
-#endif
 }
 
 void ExFragRootOperStats::init()
 {
   ExOperStats::init();
-  maxSpaceUsage_ = 0;
-  maxSpaceAlloc_ = 0;
-  maxHeapUsage_ = 0;
-  maxHeapAlloc_ = 0;
+  spaceUsage_ = 0;
+  spaceAlloc_ = 0;
+  heapUsage_ = 0;
+  heapAlloc_ = 0;
+  heapWM_ = 0;
   cpuTime_ = 0;
-#ifndef __EID
   newprocess_ = 0;
   newprocessTime_ = 0;
-  espMaxSpaceUsage_ = 0;
-  espMaxSpaceAlloc_ = 0;
-  espMaxHeapUsage_ = 0;
-  espMaxHeapAlloc_ = 0;
+  espSpaceUsage_ = 0;
+  espSpaceAlloc_ = 0;
+  espHeapUsage_ = 0;
+  espHeapAlloc_ = 0;
+  espHeapWM_ = 0;
   espCpuTime_ = 0;
   histCpuTime_ = 0;
   reqMsgCnt_ = 0;
@@ -1573,11 +1541,9 @@ void ExFragRootOperStats::init()
   pagesInUse_ = 0;
   executionCount_++;
   XPROCESSHANDLE_GETMINE_(&phandle_);
-#endif
   isFragSuspended_ = false;
   localCpuTime_ = 0;
   scratchOverflowMode_ = -1;
-#ifndef __EID
   scratchFileCount_ = 0;
   scratchBufferBlockSize_ = 0;
   scratchBufferBlockRead_ = 0;
@@ -1589,19 +1555,12 @@ void ExFragRootOperStats::init()
   waitTime_ = 0;
   maxWaitTime_ = 0;
   diffCpuTime_ = 0;
-#endif
 
   //  flags_ = 0;
 }
 
 void ExFragRootOperStats::initHistory()
 {
-#ifdef __EID
-  histMaxSpaceUsage_ = 0;
-  histMaxSpaceAlloc_ = 0;
-  histMaxHeapUsage_ = 0;
-  histMaxHeapAlloc_ = 0;
-#endif
 }
 
 UInt32 ExFragRootOperStats::packedLength()
@@ -1610,20 +1569,18 @@ UInt32 ExFragRootOperStats::packedLength()
   size = ExOperStats::packedLength();
   if (statsInDp2())
   {
-    size += sizeof(maxSpaceUsage_);
-    size += sizeof(maxSpaceAlloc_);
-    size += sizeof(maxHeapUsage_);
-    size += sizeof(maxHeapAlloc_);
+    size += sizeof(spaceUsage_);
+    size += sizeof(spaceAlloc_);
+    size += sizeof(heapUsage_);
+    size += sizeof(heapAlloc_);
     size += sizeof(cpuTime_);
   }
   else
   {
     alignSizeForNextObj(size);
     size += sizeof(ExFragRootOperStats)-sizeof(ExOperStats);
-#ifndef __EID
     if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
       size += queryIdLen_;
-#endif
   }
   return size;
 }
@@ -1636,10 +1593,10 @@ UInt32 ExFragRootOperStats::pack(char * buffer)
   if (statsInDp2())
   {
     buffer += packedLen;
-    packedLen += packIntoBuffer(buffer, maxSpaceUsage_);
-    packedLen += packIntoBuffer(buffer, maxSpaceAlloc_);
-    packedLen += packIntoBuffer(buffer, maxHeapUsage_);
-    packedLen += packIntoBuffer(buffer, maxHeapAlloc_);
+    packedLen += packIntoBuffer(buffer, spaceUsage_);
+    packedLen += packIntoBuffer(buffer, spaceAlloc_);
+    packedLen += packIntoBuffer(buffer, heapUsage_);
+    packedLen += packIntoBuffer(buffer, heapAlloc_);
     packedLen += packIntoBuffer(buffer, cpuTime_);
   }
   else
@@ -1650,21 +1607,18 @@ UInt32 ExFragRootOperStats::pack(char * buffer)
     char * srcPtr = (char *)this+sizeof(ExOperStats);
     memcpy(buffer, srcPtr, srcLen);
     packedLen += srcLen;
-#ifndef __EID
     if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
     {
       buffer += srcLen;
       if (queryIdLen_ != 0 && queryId_ != NULL)
         packedLen +=  packStrIntoBuffer(buffer, queryId_, queryIdLen_);
     }
-#endif
   }
   return packedLen;
 }
 
 void ExFragRootOperStats::unpack(const char* &buffer)
 {
-#ifndef __EID
   NABoolean dp2Stats = statsInDp2();
   NABoolean espStats = statsInEsp();
   UInt32 srcLen;
@@ -1713,46 +1667,49 @@ void ExFragRootOperStats::unpack(const char* &buffer)
   }
   if (espStats)
   {
-    espMaxSpaceUsage_ += maxSpaceUsage_;
-    espMaxSpaceAlloc_ += maxSpaceAlloc_;
-    espMaxHeapUsage_  += maxHeapUsage_;
-    espMaxHeapAlloc_ += maxHeapAlloc_;
+    espSpaceUsage_ += spaceUsage_;
+    espSpaceAlloc_ += spaceAlloc_;
+    espHeapUsage_  += heapUsage_;
+    espHeapAlloc_ += heapAlloc_;
+    espHeapWM_ += heapWM_;
     espCpuTime_ += cpuTime_;
-    maxSpaceUsage_ = 0;
-    maxSpaceAlloc_ = 0;
-    maxHeapUsage_ = 0;
-    maxHeapAlloc_ = 0;
+    spaceUsage_ = 0;
+    spaceAlloc_ = 0;
+    heapUsage_ = 0;
+    heapAlloc_ = 0;
+    heapWM_ = 0;
     cpuTime_ = 0;
   }
-#endif
 }
 
 void ExFragRootOperStats::merge(ExFragRootOperStats* other)
 {
-#ifndef __EID
   ExOperStats::merge(other);
   if (other->statsInEsp())
   {
     espCpuTime_  += other->cpuTime_;
-    espMaxSpaceUsage_ += other -> maxSpaceUsage_;
-    espMaxSpaceAlloc_ += other -> maxSpaceAlloc_;
-    espMaxHeapUsage_ += other -> maxHeapUsage_;
-    espMaxHeapAlloc_ += other -> maxHeapAlloc_;
+    espSpaceUsage_ += other -> spaceUsage_;
+    espSpaceAlloc_ += other -> spaceAlloc_;
+    espHeapUsage_ += other -> heapUsage_;
+    espHeapAlloc_ += other -> heapAlloc_;
+    espHeapWM_ += other->heapWM_;
   }
   else
   {
     cpuTime_ += other->cpuTime_;
-    maxSpaceUsage_ += other -> maxSpaceUsage_;
-    maxSpaceAlloc_ += other -> maxSpaceAlloc_;
-    maxHeapUsage_ += other -> maxHeapUsage_;
-    maxHeapAlloc_ += other -> maxHeapAlloc_;
+    spaceUsage_ += other -> spaceUsage_;
+    spaceAlloc_ += other -> spaceAlloc_;
+    heapUsage_ += other -> heapUsage_;
+    heapAlloc_ += other -> heapAlloc_;
+    heapWM_ += other->heapWM_;
   }
   newprocess_ += other -> newprocess_;
   newprocessTime_ += other -> newprocessTime_;
-  espMaxSpaceUsage_ += other -> espMaxSpaceUsage_;
-  espMaxSpaceAlloc_ += other -> espMaxSpaceAlloc_;
-  espMaxHeapUsage_ += other -> espMaxHeapUsage_;
-  espMaxHeapAlloc_ += other -> espMaxHeapAlloc_;
+  espSpaceUsage_ += other -> espSpaceUsage_;
+  espSpaceAlloc_ += other -> espSpaceAlloc_;
+  espHeapUsage_ += other -> espHeapUsage_;
+  espHeapAlloc_ += other -> espHeapAlloc_;
+  espHeapWM_ += other->espHeapWM_;
   espCpuTime_ += other -> espCpuTime_;
   reqMsgCnt_ += other -> reqMsgCnt_;
   reqMsgBytes_ += other -> reqMsgBytes_;
@@ -1780,25 +1737,20 @@ void ExFragRootOperStats::merge(ExFragRootOperStats* other)
   waitTime_ += other->waitTime_;
   if (other->maxWaitTime_ > maxWaitTime_)
      maxWaitTime_ = other->maxWaitTime_;
-#endif
-
   flags_ |= other->flags_;
 }
 
 void ExFragRootOperStats::merge(ExUDRBaseStats *other)
 {
-#ifndef __EID
   reqMsgCnt_        += other->reqMsgCnt_;
   reqMsgBytes_      += other->reqMsgBytes_;
   replyMsgCnt_      += other->replyMsgCnt_;
   replyMsgBytes_    += other->replyMsgBytes_;
   udrCpuTime_       += other->udrCpuTime_;
-#endif
 }
 
 void ExFragRootOperStats::merge(ExBMOStats *other)
 {
-#ifndef __EID
   scratchFileCount_ += other->scratchFileCount_;
   scratchOverflowMode_ = other->scratchOverflowMode_;
   
@@ -1815,8 +1767,6 @@ void ExFragRootOperStats::merge(ExBMOStats *other)
   scratchWriteCount_ += other->scratchWriteCount_;
   if(topN_ == -1 && other->topN_ > 0)
     topN_ = other->topN_;
-  
-#endif
 }
 
 void ExFragRootOperStats::merge(ExOperStats * other)
@@ -1851,7 +1801,6 @@ void ExFragRootOperStats::copyContents(ExFragRootOperStats *stat)
   char * destPtr = (char *)this+sizeof(ExOperStats);
   UInt32 srcLen = sizeof(ExFragRootOperStats)-sizeof(ExOperStats);
   memcpy((void *)destPtr, (void *)srcPtr, srcLen);
-#ifndef __EID
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
   {
     if (queryIdLen_ != 0)
@@ -1865,7 +1814,6 @@ void ExFragRootOperStats::copyContents(ExFragRootOperStats *stat)
     pagesInUse_  = stat->pagesInUse_;
   // Remember, don't merge or copy  executionCount_ !
   }
-#endif
 }
 
 ExOperStats * ExFragRootOperStats::copyOper(NAMemory * heap)
@@ -1899,7 +1847,6 @@ const char * ExFragRootOperStats::getNumValTxt(Int32 i) const
 
 Int64 ExFragRootOperStats::getNumVal(Int32 i) const
 {
-#ifndef __EID
   switch (i)
     {
     case 1:
@@ -1911,7 +1858,6 @@ Int64 ExFragRootOperStats::getNumVal(Int32 i) const
     case 4:
       return timestamp_;
     }
-#endif
   return 0;
 }
 
@@ -1924,7 +1870,6 @@ void ExFragRootOperStats::getVariableStatsInfo(char * dataBuffer,
 					       char * dataLen,
 					       Lng32 maxLen)
 {
-#ifndef __EID
   char *buf = dataBuffer;
   const char *txtVal;
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
@@ -1935,10 +1880,10 @@ void ExFragRootOperStats::getVariableStatsInfo(char * dataBuffer,
       (((txtVal = getTextVal()) != NULL) ? txtVal : "NULL"),
       ((queryId_ != NULL) ? queryId_ : "NULL"),
                 cpuTime_,
-      (UInt32)maxSpaceUsage_,
-      (UInt32)maxSpaceAlloc_,
-      (UInt32)maxHeapUsage_,
-      (UInt32)maxHeapAlloc_,
+      (UInt32)spaceUsage_,
+      (UInt32)spaceAlloc_,
+      (UInt32)heapUsage_,
+      (UInt32)heapAlloc_,
       pagesInUse_ * 16,
       diffCpuTime_);
   }
@@ -1948,7 +1893,7 @@ void ExFragRootOperStats::getVariableStatsInfo(char * dataBuffer,
     buf += *((short *) dataLen);
     str_sprintf(buf,
 		"CpuTime: %Ld ProcessId: %s StmtIndex: %d Timestamp: %Ld "
-		"SpaceUsed: %u SpaceTotal: %u HeapUsed: %u HeapTotal: %u "
+		"SpaceUsed: %u SpaceTotal: %u HeapUsed: %u HeapTotal: %u HeapWM: %u "
 		"Newprocess: %u NewprocessTime: %Ld reqMsgCnt: %Ld "
 		"regMsgBytes: %Ld replyMsgCnt: %Ld replyMsgBytes: %Ld "
 		"PMemUsed: %Ld scrOverFlowMode: %d sortTopN: %Ld"
@@ -1960,10 +1905,11 @@ void ExFragRootOperStats::getVariableStatsInfo(char * dataBuffer,
 		(((txtVal = getTextVal()) != NULL) ? txtVal : "NULL"),
 		stmtIndex_,
 		timestamp_,
-		(UInt32)maxSpaceUsage_,
-		(UInt32)maxSpaceAlloc_,
-		(UInt32)maxHeapUsage_,
-		(UInt32)maxHeapAlloc_,
+		(UInt32)spaceUsage_,
+		(UInt32)spaceAlloc_,
+		(UInt32)heapUsage_,
+		(UInt32)heapAlloc_,
+		(UInt32)heapWM_,
 		newprocess_,
 		newprocessTime_,
 		reqMsgCnt_,
@@ -1989,10 +1935,8 @@ void ExFragRootOperStats::getVariableStatsInfo(char * dataBuffer,
 
   // dataLen is really the varchar indicator
   *(short *)dataLen = (short) (buf - dataBuffer);
-#endif
 }
 
-#ifndef __EID
 Lng32 ExFragRootOperStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
 {
   char tmpBuf[100];
@@ -2022,16 +1966,19 @@ Lng32 ExFragRootOperStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
          sqlStats_item->int64_value = cpuTime_ + espCpuTime_;
       break;
     case SQLSTATS_SQL_SPACE_ALLOC:
-        sqlStats_item->int64_value = maxSpaceAlloc_ + espMaxSpaceAlloc_;
+        sqlStats_item->int64_value = spaceAlloc_ + espSpaceAlloc_;
       break;
     case SQLSTATS_SQL_SPACE_USED:
-        sqlStats_item->int64_value = maxSpaceUsage_+ espMaxSpaceUsage_;
+        sqlStats_item->int64_value = spaceUsage_+ espSpaceUsage_;
       break;
     case SQLSTATS_SQL_HEAP_ALLOC:
-        sqlStats_item->int64_value = maxHeapAlloc_+ espMaxHeapAlloc_;
+        sqlStats_item->int64_value = heapAlloc_+ espHeapAlloc_;
       break;
     case SQLSTATS_SQL_HEAP_USED:
-        sqlStats_item->int64_value = maxHeapUsage_ + espMaxHeapUsage_;
+        sqlStats_item->int64_value = heapUsage_ + espHeapUsage_;
+      break;
+    case SQLSTATS_SQL_HEAP_WM:
+        sqlStats_item->int64_value = heapWM_+ espHeapWM_;
       break;
     case SQLSTATS_PROCESS_CREATED:
       sqlStats_item->int64_value = newprocess_;
@@ -2111,7 +2058,6 @@ NABoolean ExFragRootOperStats::filterForCpuStats()
   return retcode;
 }
 
-#endif
 //////////////////////////////////////////////////////////////////
 // class ExHdfsScanStats
 //////////////////////////////////////////////////////////////////
@@ -3339,7 +3285,7 @@ void ExPartitionAccessStats::getVariableStatsInfo(char * dataBuffer,
 
   *(short*)dataLen = (short) (buf - dataBuffer);
 }
-#ifndef __EID
+
 Lng32 ExPartitionAccessStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
 {
   ExOperStats::getStatsItem(sqlStats_item);
@@ -3377,7 +3323,6 @@ Lng32 ExPartitionAccessStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
   }
   return 0;
 }
-#endif
 
 //////////////////////////////////////////////////////////////////
 // class ExHashGroupByStats
@@ -4569,68 +4514,51 @@ ExMeasStats::ExMeasStats(NAMemory * heap,
 			 const ComTdb * tdb)
      : ExMeasBaseStats(heap, MEAS_STATS, tcb, NULL)
 {
-#ifndef __EID
   executionCount_ = 0;
-#endif
   init();
   initHistory();
   if (tdb != NULL)
     scratchOverflowMode_ = ((ComTdb *)tdb)->getOverFlowMode();
-#ifndef __EID
   queryId_ = NULL;
   queryIdLen_ = 0;
-#endif
 }
 
 ExMeasStats::ExMeasStats(NAMemory * heap)
      : ExMeasBaseStats(heap, MEAS_STATS)
 {  
-#ifndef __EID
   executionCount_ = 0;
-#endif
-
   init();
   initHistory();
-#ifndef __EID
   queryId_ = NULL;
   queryIdLen_ = 0;
-#endif
 }
 
 ExMeasStats::~ExMeasStats()
 {
-#ifndef __EID
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS && queryId_ != NULL)
   {
     NADELETEBASIC(queryId_, getHeap());
     queryId_ = NULL;
   }
-#endif
 }
 
 void ExMeasStats::initHistory()
 {
-#ifdef __EID
-  histMaxSpaceUsage_ = 0;
-  histMaxSpaceAlloc_ = 0;
-  histMaxHeapUsage_ = 0;
-  histMaxHeapAlloc_ = 0;
-#endif
 }
 
 UInt32 ExMeasStats::packedLength()
 {
   UInt32 size;
-#ifndef __EID
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
   {
     size = ExMeasBaseStats::packedLength();
     size += sizeof(queryIdLen_);
     size += queryIdLen_;
-    size += sizeof(maxSpaceUsage_);
-    size += sizeof(maxSpaceAlloc_);
-    size += sizeof(maxHeapUsage_);
-    size += sizeof(maxHeapAlloc_);
+    size += sizeof(spaceUsage_);
+    size += sizeof(spaceAlloc_);
+    size += sizeof(heapUsage_);
+    size += sizeof(heapAlloc_);
+    size += sizeof(heapWM_);
     size += sizeof(cpuTime_);
     size += sizeof(executionCount_);
     size += sizeof(phandle_);
@@ -4639,10 +4567,11 @@ UInt32 ExMeasStats::packedLength()
   if ((Int32)getCollectStatsType() == SQLCLI_QID_DETAIL_STATS)
   {
     size = ExMeasBaseStats::packedLength();
-    size += sizeof(maxSpaceUsage_);
-    size += sizeof(maxSpaceAlloc_);
-    size += sizeof(maxHeapUsage_);
-    size += sizeof(maxHeapAlloc_);
+    size += sizeof(spaceUsage_);
+    size += sizeof(spaceAlloc_);
+    size += sizeof(heapUsage_);
+    size += sizeof(heapAlloc_);
+    size += sizeof(heapWM_);
     size += sizeof(cpuTime_);
     size += sizeof(reqMsgCnt_);
     size += sizeof(reqMsgBytes_);
@@ -4652,7 +4581,6 @@ UInt32 ExMeasStats::packedLength()
     size += sizeof(phandle_);
   }
   else
-#endif
   {
     size = ExMeasBaseStats::packedLength();
     if (NOT statsInDp2())
@@ -4662,10 +4590,11 @@ UInt32 ExMeasStats::packedLength()
     }
     else
     {
-      size += sizeof(maxSpaceUsage_);
-      size += sizeof(maxSpaceAlloc_);
-      size += sizeof(maxHeapUsage_);
-      size += sizeof(maxHeapAlloc_);
+      size += sizeof(spaceUsage_);
+      size += sizeof(spaceAlloc_);
+      size += sizeof(heapUsage_);
+      size += sizeof(heapAlloc_);
+      size += sizeof(heapWM_);
     }
   }
   return size;
@@ -4676,7 +4605,6 @@ UInt32 ExMeasStats::pack(char * buffer)
   UInt32 srcLen = 0;
 
   UInt32 size;
-#ifndef __EID
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
   {
     size = ExMeasBaseStats::pack(buffer);
@@ -4684,10 +4612,11 @@ UInt32 ExMeasStats::pack(char * buffer)
     size += packIntoBuffer(buffer, queryIdLen_);
     if (queryIdLen_ != 0 && queryId_ != NULL)
       size += packStrIntoBuffer(buffer, queryId_, queryIdLen_);
-    size += packIntoBuffer(buffer, maxSpaceUsage_);
-    size += packIntoBuffer(buffer, maxSpaceAlloc_);
-    size += packIntoBuffer(buffer, maxHeapUsage_);
-    size += packIntoBuffer(buffer, maxHeapAlloc_);
+    size += packIntoBuffer(buffer, spaceUsage_);
+    size += packIntoBuffer(buffer, spaceAlloc_);
+    size += packIntoBuffer(buffer, heapUsage_);
+    size += packIntoBuffer(buffer, heapAlloc_);
+    size += packIntoBuffer(buffer, heapWM_);
     size += packIntoBuffer(buffer, cpuTime_);  
     size += packIntoBuffer(buffer, executionCount_);
     memcpy(buffer, (const void *)&phandle_, sizeof(phandle_));
@@ -4699,10 +4628,11 @@ UInt32 ExMeasStats::pack(char * buffer)
   {
     size = ExMeasBaseStats::pack(buffer);
     buffer += size;
-    size += packIntoBuffer(buffer, maxSpaceUsage_);
-    size += packIntoBuffer(buffer, maxSpaceAlloc_);
-    size += packIntoBuffer(buffer, maxHeapUsage_);
-    size += packIntoBuffer(buffer, maxHeapAlloc_);
+    size += packIntoBuffer(buffer, spaceUsage_);
+    size += packIntoBuffer(buffer, spaceAlloc_);
+    size += packIntoBuffer(buffer, heapUsage_);
+    size += packIntoBuffer(buffer, heapAlloc_);
+    size += packIntoBuffer(buffer, heapWM_);
     size += packIntoBuffer(buffer, cpuTime_);  
     size += packIntoBuffer(buffer, reqMsgCnt_);
     size += packIntoBuffer(buffer, reqMsgBytes_);
@@ -4714,7 +4644,6 @@ UInt32 ExMeasStats::pack(char * buffer)
     buffer += sizeof(phandle_);
   }
   else
-#endif
   {
     size = ExMeasBaseStats::pack(buffer);
     if (NOT statsInDp2())
@@ -4731,10 +4660,11 @@ UInt32 ExMeasStats::pack(char * buffer)
       buffer += size;
       if (getVersion() >= _STATS_RTS_VERSION_R22)
       {
-        size += packIntoBuffer(buffer, maxSpaceUsage_);
-        size += packIntoBuffer(buffer, maxSpaceAlloc_);
-        size += packIntoBuffer(buffer, maxHeapUsage_);
-        size += packIntoBuffer(buffer, maxHeapAlloc_);
+        size += packIntoBuffer(buffer, spaceUsage_);
+        size += packIntoBuffer(buffer, spaceAlloc_);
+        size += packIntoBuffer(buffer, heapUsage_);
+        size += packIntoBuffer(buffer, heapAlloc_);
+        size += packIntoBuffer(buffer, heapWM_);
       }
     }
   }
@@ -4744,7 +4674,6 @@ UInt32 ExMeasStats::pack(char * buffer)
 void ExMeasStats::unpack(const char* &buffer)
 {
   ExMeasBaseStats::unpack(buffer);
-#ifndef __EID
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
   {
     unpackBuffer(buffer, queryIdLen_);
@@ -4754,10 +4683,11 @@ void ExMeasStats::unpack(const char* &buffer)
       unpackStrFromBuffer(buffer, queryId_, queryIdLen_);
       queryId_[queryIdLen_] = '\0';
     }
-    unpackBuffer(buffer, maxSpaceUsage_);
-    unpackBuffer(buffer, maxSpaceAlloc_);
-    unpackBuffer(buffer, maxHeapUsage_);
-    unpackBuffer(buffer, maxHeapAlloc_);
+    unpackBuffer(buffer, spaceUsage_);
+    unpackBuffer(buffer, spaceAlloc_);
+    unpackBuffer(buffer, heapUsage_);
+    unpackBuffer(buffer, heapAlloc_);
+    unpackBuffer(buffer, heapWM_);
     unpackBuffer(buffer, cpuTime_);
     unpackBuffer(buffer, executionCount_);
     memcpy((void *)&phandle_, buffer, sizeof(phandle_));
@@ -4766,10 +4696,11 @@ void ExMeasStats::unpack(const char* &buffer)
   else
   if ((Int32)getCollectStatsType() == SQLCLI_QID_DETAIL_STATS)
   {
-    unpackBuffer(buffer, maxSpaceUsage_);
-    unpackBuffer(buffer, maxSpaceAlloc_);
-    unpackBuffer(buffer, maxHeapUsage_);
-    unpackBuffer(buffer, maxHeapAlloc_);
+    unpackBuffer(buffer, spaceUsage_);
+    unpackBuffer(buffer, spaceAlloc_);
+    unpackBuffer(buffer, heapUsage_);
+    unpackBuffer(buffer, heapAlloc_);
+    unpackBuffer(buffer, heapWM_);
     unpackBuffer(buffer, cpuTime_);
     unpackBuffer(buffer, reqMsgCnt_);
     unpackBuffer(buffer, reqMsgBytes_);
@@ -4780,7 +4711,6 @@ void ExMeasStats::unpack(const char* &buffer)
     buffer += sizeof(phandle_);
   }
   else
-#endif
   {
     if (NOT statsInDp2())
     {
@@ -4789,21 +4719,21 @@ void ExMeasStats::unpack(const char* &buffer)
       char * srcPtr = (char *)this+sizeof(ExMeasBaseStats);
       memcpy((void *)srcPtr, buffer, srcLen);
       buffer += srcLen;
-#ifndef __EID
       if (statsInEsp())
       {
-        espMaxSpaceUsage_ += maxSpaceUsage_;
-        espMaxSpaceAlloc_ += maxSpaceAlloc_;
-        espMaxHeapUsage_  += maxHeapUsage_;
-        espMaxHeapAlloc_ += maxHeapAlloc_;
+        espSpaceUsage_ += spaceUsage_;
+        espSpaceAlloc_ += spaceAlloc_;
+        espHeapUsage_  += heapUsage_;
+        espHeapAlloc_ += heapAlloc_;
+        espHeapAlloc_ += heapWM_;
         espCpuTime_ += cpuTime_;
-        maxSpaceUsage_ = 0;
-        maxSpaceAlloc_ = 0;
-        maxHeapUsage_ = 0;
-        maxHeapAlloc_ = 0;
+        spaceUsage_ = 0;
+        spaceAlloc_ = 0;
+        heapUsage_ = 0;
+        heapAlloc_ = 0;
+        heapWM_ = 0;
         cpuTime_ = 0;
       }
-#endif
     }
   }
 }
@@ -4816,16 +4746,17 @@ void ExMeasStats::init()
   timeouts_ = 0;
   numSorts_ = 0;
   sortElapsedTime_ = 0;
-  maxSpaceUsage_ = 0;
-  maxSpaceAlloc_ = 0;
-  maxHeapUsage_ = 0;
-  maxHeapAlloc_ = 0;
-#ifndef __EID
+  spaceUsage_ = 0;
+  spaceAlloc_ = 0;
+  heapUsage_ = 0;
+  heapAlloc_ = 0;
+  heapWM_ = 0;
   cpuTime_ = 0;
-  espMaxSpaceUsage_ = 0;
-  espMaxSpaceAlloc_ = 0;
-  espMaxHeapUsage_ = 0;
-  espMaxHeapAlloc_ = 0;
+  espSpaceUsage_ = 0;
+  espSpaceAlloc_ = 0;
+  espHeapUsage_ = 0;
+  espHeapAlloc_ = 0;
+  espHeapWM_ = 0;
   espCpuTime_ = 0;
   histCpuTime_ = 0;
   reqMsgCnt_ = 0;
@@ -4834,11 +4765,9 @@ void ExMeasStats::init()
   replyMsgBytes_ = 0;
   executionCount_++;
   XPROCESSHANDLE_GETMINE_(&phandle_);
-#endif
   isFragSuspended_ = false;
   localCpuTime_ = 0;
   scratchOverflowMode_ = -1;
-#ifndef __EID
   scratchFileCount_ = 0;
   scratchBufferBlockSize_ = 0;
   scratchBufferBlockRead_ = 0;
@@ -4847,48 +4776,44 @@ void ExMeasStats::init()
   scratchReadCount_ = 0;
   udrCpuTime_ = 0;
   topN_ = -1;
-#endif
 }
 
 void ExMeasStats::merge(ExFragRootOperStats* other)
 {
   ExOperStats::merge(other);
-  maxSpaceUsage_ += other -> maxSpaceUsage_; 
-  maxSpaceAlloc_ += other -> maxSpaceAlloc_; 
-  maxHeapUsage_  += other -> maxHeapUsage_; 
-  maxHeapAlloc_  += other -> maxHeapAlloc_;
+  spaceUsage_ += other -> spaceUsage_; 
+  spaceAlloc_ += other -> spaceAlloc_; 
+  heapUsage_  += other -> heapUsage_; 
+  heapAlloc_  += other -> heapAlloc_;
+  heapWM_  += other -> heapWM_;
   if (scratchOverflowMode_ == -1)
     scratchOverflowMode_ = other->scratchOverflowMode_;
-#ifndef __EID
   cpuTime_          += other -> cpuTime_;
   newprocess_       += other -> newprocess_; 
   newprocessTime_   += other -> newprocessTime_; 
-  espMaxSpaceUsage_ += other -> espMaxSpaceUsage_;
-  espMaxSpaceAlloc_ += other -> espMaxSpaceAlloc_;
-  espMaxHeapUsage_  += other -> espMaxHeapUsage_;
-  espMaxHeapAlloc_  += other -> espMaxHeapAlloc_;
+  espSpaceUsage_ += other -> espSpaceUsage_;
+  espSpaceAlloc_ += other -> espSpaceAlloc_;
+  espHeapUsage_  += other -> espHeapUsage_;
+  espHeapAlloc_  += other -> espHeapAlloc_;
+  espHeapWM_     += other -> espHeapWM_;
   espCpuTime_       += other -> espCpuTime_;
   reqMsgCnt_        += other -> reqMsgCnt_;
   reqMsgBytes_      += other -> reqMsgBytes_;
   replyMsgCnt_      += other -> replyMsgCnt_;
   replyMsgBytes_    += other -> replyMsgBytes_;
-#endif
 }
 
 void ExMeasStats::merge(ExUDRBaseStats *other)
 {
-#ifndef __EID
   reqMsgCnt_        += other->reqMsgCnt_;
   reqMsgBytes_      += other->reqMsgBytes_;
   replyMsgCnt_      += other->replyMsgCnt_;
   replyMsgBytes_    += other->replyMsgBytes_;
   udrCpuTime_       += other->udrCpuTime_;
-#endif
 }
 
 void ExMeasStats::merge(ExBMOStats *other)
 {
-#ifndef __EID
   scratchFileCount_ += other->scratchFileCount_;
   scratchOverflowMode_ = other->scratchOverflowMode_;
   if (scratchBufferBlockSize_ == 0 &&
@@ -4904,8 +4829,6 @@ void ExMeasStats::merge(ExBMOStats *other)
   scratchWriteCount_ += other->scratchWriteCount_;
   if (topN_ == -1 && other->topN_ > 0)
       topN_ = other->topN_;
-
-#endif
 }
 
 void ExMeasStats::merge(ExHdfsScanStats* other)
@@ -4934,18 +4857,19 @@ void ExMeasStats::merge(ExMeasStats* other)
   timeouts_        += other -> timeouts_; 
   numSorts_        += other -> numSorts_; 
   sortElapsedTime_ += other -> sortElapsedTime_; 
-  maxSpaceUsage_   += other -> maxSpaceUsage_; 
-  maxSpaceAlloc_   += other -> maxSpaceAlloc_; 
-  maxHeapUsage_    += other -> maxHeapUsage_; 
-  maxHeapAlloc_    += other -> maxHeapAlloc_; 
+  spaceUsage_   += other -> spaceUsage_; 
+  spaceAlloc_   += other -> spaceAlloc_; 
+  heapUsage_    += other -> heapUsage_; 
+  heapAlloc_    += other -> heapAlloc_; 
+  heapWM_       += other -> heapWM_; 
   if (scratchOverflowMode_ == -1)
     scratchOverflowMode_ = other->scratchOverflowMode_;
-#ifndef __EID
   cpuTime_          += other -> cpuTime_;
-  espMaxSpaceUsage_ += other -> espMaxSpaceUsage_;
-  espMaxSpaceAlloc_ += other -> espMaxSpaceAlloc_;
-  espMaxHeapUsage_  += other -> espMaxHeapUsage_;
-  espMaxHeapAlloc_  += other -> espMaxHeapAlloc_;
+  espSpaceUsage_ += other -> espSpaceUsage_;
+  espSpaceAlloc_ += other -> espSpaceAlloc_;
+  espHeapUsage_  += other -> espHeapUsage_;
+  espHeapAlloc_  += other -> espHeapAlloc_;
+  espHeapWM_     += other -> espHeapWM_;
   espCpuTime_       += other -> espCpuTime_;
   reqMsgCnt_        += other -> reqMsgCnt_;
   reqMsgBytes_      += other -> reqMsgBytes_;
@@ -4967,8 +4891,6 @@ void ExMeasStats::merge(ExMeasStats* other)
   udrCpuTime_ += other->udrCpuTime_;
   if (topN_ == -1 && other->topN_ > 0)
       topN_ = other->topN_;
-
-#endif
 }
 
 
@@ -5009,14 +4931,14 @@ ExOperStats * ExMeasStats::copyOper(NAMemory * heap)
 
 void ExMeasStats::copyContents(ExMeasStats *other)
 {
-#ifndef __EID
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
   {
     cpuTime_ = other->cpuTime_;
-    maxSpaceUsage_ = other->maxSpaceUsage_;
-    maxSpaceAlloc_ = other->maxSpaceAlloc_;
-    maxHeapUsage_ = other->maxHeapUsage_;
-    maxHeapAlloc_ = other->maxHeapAlloc_;
+    spaceUsage_ = other->spaceUsage_;
+    spaceAlloc_ = other->spaceAlloc_;
+    heapUsage_ = other->heapUsage_;
+    heapAlloc_ = other->heapAlloc_;
+    heapWM_ = other->heapWM_;
     queryIdLen_ = other->queryIdLen_;
     if (queryIdLen_ != 0)
     {
@@ -5031,17 +4953,17 @@ void ExMeasStats::copyContents(ExMeasStats *other)
   if ((Int32)getCollectStatsType() == SQLCLI_QID_DETAIL_STATS)
   {
     cpuTime_ = other->cpuTime_;
-    maxSpaceUsage_ = other->maxSpaceUsage_;
-    maxSpaceAlloc_ = other->maxSpaceAlloc_;
-    maxHeapUsage_ = other->maxHeapUsage_;
-    maxHeapAlloc_ = other->maxHeapAlloc_;
+    spaceUsage_ = other->spaceUsage_;
+    spaceAlloc_ = other->spaceAlloc_;
+    heapUsage_ = other->heapUsage_;
+    heapAlloc_ = other->heapAlloc_;
+    heapWM_ = other->heapWM_;
     reqMsgCnt_ = other->reqMsgCnt_;
     reqMsgBytes_ = other->reqMsgBytes_;
     replyMsgCnt_  = other->replyMsgCnt_;
     replyMsgBytes_  = other->replyMsgBytes_;
   }
   else
-#endif
   {
   ExMeasBaseStats::copyContents(other);
   newprocess_ = other->newprocess_; 
@@ -5049,18 +4971,19 @@ void ExMeasStats::copyContents(ExMeasStats *other)
   timeouts_ = other->timeouts_; 
   numSorts_ = other->numSorts_;
   sortElapsedTime_ = other->sortElapsedTime_;
-  maxSpaceUsage_ = other->maxSpaceUsage_;
-  maxSpaceAlloc_ = other->maxSpaceAlloc_;
-  maxHeapUsage_ = other->maxHeapUsage_;
-  maxHeapAlloc_ = other->maxHeapAlloc_;
+  spaceUsage_ = other->spaceUsage_;
+  spaceAlloc_ = other->spaceAlloc_;
+  heapUsage_ = other->heapUsage_;
+  heapAlloc_ = other->heapAlloc_;
+  heapWM_ = other->heapWM_;
   if (scratchOverflowMode_ == -1)
     scratchOverflowMode_ = other->scratchOverflowMode_;
-#ifndef __EID
   cpuTime_ = other->cpuTime_;
-  espMaxSpaceUsage_ = other->espMaxSpaceUsage_; 
-  espMaxSpaceAlloc_ = other->espMaxSpaceAlloc_; 
-  espMaxHeapUsage_ = other->espMaxHeapUsage_; 
-  espMaxHeapAlloc_ = other->espMaxHeapAlloc_; 
+  espSpaceUsage_ = other->espSpaceUsage_; 
+  espSpaceAlloc_ = other->espSpaceAlloc_; 
+  espHeapUsage_ = other->espHeapUsage_; 
+  espHeapAlloc_ = other->espHeapAlloc_; 
+  espHeapWM_ = other->espHeapWM_; 
   espCpuTime_ = other->espCpuTime_;
   histCpuTime_ = other->histCpuTime_;
   queryIdLen_ = other->queryIdLen_;
@@ -5077,7 +5000,6 @@ void ExMeasStats::copyContents(ExMeasStats *other)
   scratchWriteCount_ = other->scratchWriteCount_;
   udrCpuTime_ = other->udrCpuTime_;
   topN_ = other->topN_;
-#endif
   }
 }
 
@@ -5100,7 +5022,6 @@ void ExMeasStats::getVariableStatsInfo(char * dataBuffer, char * datalen,
 				       Lng32 maxLen)
 {
   char * buf = dataBuffer;
-#ifndef __EID
   if ((Int32)getCollectStatsType() == SQLCLI_CPU_OFFENDER_STATS)
   {
     str_sprintf(buf, "statsRowType: %d ProcessId: %s Qid: %s CpuTime: %Ld SpaceUsed: %u SpaceTotal: %u HeapUsed: %u HeapTotal: %u ",
@@ -5108,22 +5029,23 @@ void ExMeasStats::getVariableStatsInfo(char * dataBuffer, char * datalen,
       "NULL",
       ((queryId_ != NULL) ? queryId_ : "NULL"),
       cpuTime_,
-      (UInt32)maxSpaceUsage_,
-      (UInt32)maxSpaceAlloc_,
-      (UInt32)maxHeapUsage_,
-      (UInt32)maxHeapAlloc_);
+      (UInt32)spaceUsage_,
+      (UInt32)spaceAlloc_,
+      (UInt32)heapUsage_,
+      (UInt32)heapAlloc_);
   }
   else
   if ((Int32)getCollectStatsType() == SQLCLI_QID_DETAIL_STATS)
   {
-    str_sprintf(buf, "statsRowType: %d ProcessId: %s CpuTime: %Ld SpaceUsed: %u SpaceTotal: %u HeapUsed: %u HeapTotal: %u reqMsgCnt: %Ld reqMsgBytes: %Ld replyMsgCnt: %Ld replyMsgBytes: %Ld ",
+    str_sprintf(buf, "statsRowType: %d ProcessId: %s CpuTime: %Ld SpaceUsed: %u SpaceTotal: %u HeapUsed: %u HeapTotal: %u HeapWM: %u reqMsgCnt: %Ld reqMsgBytes: %Ld replyMsgCnt: %Ld replyMsgBytes: %Ld ",
       statType(),
       "NULL",
       cpuTime_,
-      (UInt32)maxSpaceUsage_,
-      (UInt32)maxSpaceAlloc_,
-      (UInt32)maxHeapUsage_,
-      (UInt32)maxHeapAlloc_,
+      (UInt32)spaceUsage_,
+      (UInt32)spaceAlloc_,
+      (UInt32)heapUsage_,
+      (UInt32)heapAlloc_,
+      (UInt32)heapWM_,
       reqMsgCnt_,
       reqMsgBytes_,
       replyMsgCnt_,
@@ -5137,7 +5059,7 @@ void ExMeasStats::getVariableStatsInfo(char * dataBuffer, char * datalen,
 
   str_sprintf(buf, 
     "statsRowType: %d Newprocess: %u NewprocessTime: %Ld Timeouts: %u NumSorts: %u SortElapsedTime: %Ld "
-    "SpaceTotal: %d  SpaceUsed: %d HeapTotal: %d HeapUsed: %d CpuTime: %Ld "
+    "SpaceTotal: %d  SpaceUsed: %d HeapTotal: %d HeapUsed: %d HeapWM: %u CpuTime: %Ld "
     "reqMsgCnt: %Ld reqMsgBytes: %Ld replyMsgCnt: %Ld "
     "replyMsgBytes: %Ld scrOverflowMode: %d sortTopN: %Ld"
     "scrFileCount: %d scrBufferBlockSize: %d scrBufferRead: %Ld scrBufferWritten: %Ld "
@@ -5148,10 +5070,11 @@ void ExMeasStats::getVariableStatsInfo(char * dataBuffer, char * datalen,
 	      getTimeouts(),
 	      getNumSorts(),
 	      getSortElapsedTime(),
-              maxSpaceAlloc_ + espMaxSpaceAlloc_,
-              maxSpaceUsage_ + espMaxSpaceUsage_,
-              maxHeapAlloc_ + espMaxHeapAlloc_,
-              maxHeapUsage_ + espMaxHeapUsage_,
+              spaceAlloc_ + espSpaceAlloc_,
+              spaceUsage_ + espSpaceUsage_,
+              heapAlloc_ + espHeapAlloc_,
+              heapUsage_ + espHeapUsage_,
+              heapWM_ + espHeapWM_,
               cpuTime_ + espCpuTime_,
               reqMsgCnt_,
               reqMsgBytes_,
@@ -5172,46 +5095,25 @@ void ExMeasStats::getVariableStatsInfo(char * dataBuffer, char * datalen,
 
   // dataLen is really the varchar indicator
   *(short *)datalen = (short) (buf - dataBuffer);
-#endif
 }
 
 void ExMeasStats::updateSpaceUsage(Space *space,
 					   CollHeap *heap)
 {
-#ifdef __EID
   if (space)
   {
-    Int32 currentSpaceUsage = (Int32)((Space *) space)->getAllocSize() >> 10;
-    Int32 currentSpaceAlloc = (Int32)((Space *) space)->getTotalSize() >> 10;
-    maxSpaceUsage_ = currentSpaceUsage - histMaxSpaceUsage_;
-    maxSpaceAlloc_ = currentSpaceAlloc - histMaxSpaceAlloc_;
-    histMaxSpaceUsage_ = currentSpaceUsage;
-    histMaxSpaceAlloc_ = currentSpaceAlloc;
-  }
-  if (heap)
-  {
-    Int32 currentHeapUsage = (Int32)((NAMemory *) heap)->getAllocSize() >> 10;
-    Int32 currentHeapAlloc = (Int32)((NAMemory *) heap)->getTotalSize() >> 10;
-    maxHeapUsage_ = currentHeapUsage - histMaxHeapUsage_;
-    maxHeapAlloc_ = currentHeapAlloc - histMaxHeapAlloc_;
-    histMaxHeapUsage_ = currentHeapUsage;
-    histMaxHeapAlloc_ = currentHeapAlloc;
-  }
-#else
-  if (space)
-  {
-      maxSpaceUsage_ = (Int32)(((Space *) space)->getAllocSize() >> 10);
-      maxSpaceAlloc_ = (Int32)(((Space *) space)->getTotalSize() >> 10);
+      spaceUsage_ = (Int32)(((Space *) space)->getAllocSize() >> 10);
+      spaceAlloc_ = (Int32)(((Space *) space)->getTotalSize() >> 10);
+      
   }
   if (heap)
   {
-      maxHeapUsage_ = (Int32)(((NAMemory *) heap)->getAllocSize() >> 10);
-      maxHeapAlloc_ = (Int32)(((NAMemory *) heap)->getTotalSize() >> 10);
+      heapUsage_ = (Int32)(((NAMemory *) heap)->getAllocSize() >> 10);
+      heapAlloc_ = (Int32)(((NAMemory *) heap)->getTotalSize() >> 10);
+      heapWM_ = (Int32)(((NAMemory *) heap)->getHighWaterMark() >> 10);
   }
-#endif
 }
 
-#ifndef __EID
 Lng32 ExMeasStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
 {
   sqlStats_item->error_code = 0;
@@ -5236,16 +5138,19 @@ Lng32 ExMeasStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
     sqlStats_item->int64_value = cpuTime_ + espCpuTime_;
     break;
   case SQLSTATS_SQL_SPACE_ALLOC:
-    sqlStats_item->int64_value = maxSpaceAlloc_ + espMaxSpaceAlloc_;
+    sqlStats_item->int64_value = spaceAlloc_ + espSpaceAlloc_;
     break;
   case SQLSTATS_SQL_SPACE_USED:
-    sqlStats_item->int64_value = maxSpaceUsage_ + espMaxSpaceUsage_;
+    sqlStats_item->int64_value = spaceUsage_ + espSpaceUsage_;
     break;
   case SQLSTATS_SQL_HEAP_ALLOC:
-    sqlStats_item->int64_value = maxHeapAlloc_ + espMaxHeapAlloc_;
+    sqlStats_item->int64_value = heapAlloc_ + espHeapAlloc_;
     break;
   case SQLSTATS_SQL_HEAP_USED:
-    sqlStats_item->int64_value = maxHeapUsage_ + espMaxHeapUsage_;
+    sqlStats_item->int64_value = heapUsage_ + espHeapUsage_;
+    break;
+  case SQLSTATS_SQL_HEAP_WM:
+    sqlStats_item->int64_value = heapWM_ + espHeapWM_;
     break;
   case SQLSTATS_PROCESS_CREATED:
     sqlStats_item->int64_value = newprocess_;
@@ -5309,7 +5214,6 @@ NABoolean ExMeasStats::filterForCpuStats()
   setCpuStatsHistory();
   return retcode;
 }
-#endif
 
 ////////////////////////////////////////////////////////////////
 // class ExUDRStats
@@ -5595,14 +5499,12 @@ void ExStatisticsArea::removeEntries()
       case ExOperStats::UDR_STATS:
         NADELETE((ExUDRStats *)stat, ExUDRStats, heap_);
         break;
-#ifndef __EID
       case ExOperStats::RMS_STATS:
         NADELETE((ExRMSStats *)stat, ExRMSStats, heap_);
         break;
       case ExOperStats::BMO_STATS:
         NADELETE((ExBMOStats *)stat, ExBMOStats, heap_);
         break;
-#endif
       case ExOperStats::UDR_BASE_STATS:
         NADELETE((ExUDRBaseStats *)stat, ExUDRBaseStats, heap_);
         break;
@@ -6323,121 +6225,7 @@ ExOperStats * ExStatisticsArea::get(Lng32 tdbId)
 {
   return get(ExOperStats::NO_OP, tdbId); 
 }
-/*
-//////////////////////////////////////////////////////////////////
-// scan all ExOperStats entries and update stmtCntrs.
-//////////////////////////////////////////////////////////////////
-
-Int32  ExStatisticsArea::updateStmtCntrs(ExMeasStmtCntrs * stmtCntrs,
-				       Int32 statementCount,
-				       char *moduleName, Int32 moduleNameLen
-				       )
-{
-#ifndef __EID
-
-  // Only update sqlstmt stats if not olt.
-  // For olt queries, the counters are updated by ArkFS in 
-  // ArkFsSession::processReply() using reply data from dp2.
-  position();
-  ExMeasStats * stat = getNext()->castToExMeasStats();
-  if (stat)
-    {
-      stmtCntrs->incRowsAccessed (stat->exeSEStats()->getAccessedDP2Rows());
-      stmtCntrs->incRowsUsed (stat->exeSE()->getUsedDP2Rows());
-      stmtCntrs->incEscalations ((short)stat->exeSEStats()->getEscalations());
-      stmtCntrs->incDiscReads (stat->exeSEStats()->getDiskReads());
-      stmtCntrs->incLockWaits ((short)stat->exeSEStats()->getLockWaits());
-      stmtCntrs->incTimeouts ((short)stat->exeSEStats());
-      stmtCntrs->incMessages (stat->exeSEStats()->getNumMessages());
-      stmtCntrs->incMessageBytes (stat->exeSEStats()->getMessageBytes());
-
-      // now that the ExOperStats have been read, re-initialize
-      // them for the next execution of this statement.
-      initEntries();
-    }
-
-  // call Measure function to update the statment counters. 
-  return stmtCntrs->ExMeasStmtCntrsBump(statementCount, moduleName, 
-					moduleNameLen );
-  
-#else
-  return 0;
-#endif
-};
 
-void ExStatisticsArea::allocDynamicStmtCntrs(const char * stmtName)
-{
-#ifndef __EID
-  // Allocate a stmt counter and set the
-  // module name to SQLMX^EXECUTE_<stmt-name>
-  Int32 nameLen = 0;
-  char modName[MODULE_ID_SIZE + 1];
-  modName[MODULE_ID_SIZE] = 0;
-  str_pad (&modName[0], MODULE_ID_SIZE);
-  str_cpy (&modName[0], DYNAMIC_STMT_NAME, DYNAMIC_STMT_NAME_SIZE);
-	     
-  if (stmtName) 
-    {
-       nameLen = str_len(stmtName);
-      if (nameLen > (MODULE_ID_SIZE - DYNAMIC_STMT_NAME_SIZE))
-	nameLen = MODULE_ID_SIZE - DYNAMIC_STMT_NAME_SIZE;		 
-      str_cpy (&modName[DYNAMIC_STMT_NAME_SIZE], stmtName, nameLen);
-    }
-  stmtCntrs_ = new(heap_)ExMeasStmtCntrs();
-  stmtCntrs_->ExMeasStmtCntrsBump(1, &modName[0], 
-				  nameLen + DYNAMIC_STMT_NAME_SIZE);
-  deallocStmtCntrs_ = TRUE;
-#endif
-}  
-
-Int32 ExStatisticsArea::getMeasOpensCntr()
-{
-  entries_->position();
-
-  ExMeasStats * stat;
-  if ((stat = (ExMeasStats *)entries_->getNext()) != NULL &&
-      (stat->statType() == ExOperStats::MEAS_STATS))
-    return stat->getOpens();
-  else
-    return 0;
-};
-
-Int64 ExStatisticsArea::getMeasOpenTimeCntr()
-{
-  entries_->position();
-
-  ExMeasStats * stat;
-  if ((stat = (ExMeasStats *)entries_->getNext()) != NULL &&
-      (stat->statType() == ExOperStats::MEAS_STATS))
-    return stat->getOpenTime();
-  else
-    return 0;
-};
-
-Int32 ExStatisticsArea::getMeasNewprocessCntr()
-{
-  entries_->position();
-
-  ExMeasStats * stat;
-  if ((stat = (ExMeasStats *)entries_->getNext()) != NULL &&
-      (stat->statType() == ExOperStats::MEAS_STATS))
-    return stat->getNewprocess();
-  else
-    return 0;
-};
-
-Int64 ExStatisticsArea::getMeasNewprocessTimeCntr()
-{
-  entries_->position();
-
-  ExMeasStats * stat;
-  if ((stat = (ExMeasStats *)entries_->getNext()) != NULL &&
-      (stat->statType() == ExOperStats::MEAS_STATS))
-    return stat->getNewprocessTime();
-  else
-    return 0;
-};
-*/
 void ExStatisticsArea::setMasterStats(ExMasterStats *masterStats)
 { 
   masterStats_ = masterStats; 
@@ -6651,14 +6439,12 @@ void ExStatisticsArea::unpackThisClass(const char* &buffer, ExOperStats *parentS
     case ExOperStats::UDR_STATS:
       stat = new(heap_) ExUDRStats(heap_);
       break;
-#ifndef __EID
     case ExOperStats::RMS_STATS:
       stat = new(heap_) ExRMSStats((NAHeap *)heap_);
       break;
     case ExOperStats::BMO_STATS:
       stat = new(heap_) ExBMOStats((NAHeap *)heap_);
       break;
-#endif
     case ExOperStats::UDR_BASE_STATS:
       stat = new(heap_) ExUDRBaseStats((NAHeap *)heap_);
       break;
@@ -6792,7 +6578,6 @@ void ExStatisticsArea::initHistoryEntries()
   }
 }
 
-#ifndef __EID
 Lng32 ExStatisticsArea::getStatsItems(Lng32 no_of_stats_items,
 	    SQLSTATS_ITEM sqlStats_items[])
 {
@@ -7569,8 +7354,7 @@ void ExStatisticsArea::setQueryId(char *queryId, Lng32 queryIdLen)
        stat->castToExFragRootOperStats()->setQueryId(queryId, queryIdLen);
   }
 }
-#endif
-#ifndef __EID
+
 ///////////////////////////////////////////////////////////////////
 // Methods for ExStatsTdb and ExStatsTcb.
 ///////////////////////////////////////////////////////////////////
@@ -8679,7 +8463,6 @@ ex_tcb_private_state * ExStatsPrivateState::allocate_new(const ex_tcb *tcb)
   return new(((ex_tcb *)tcb)->getSpace()) ExStatsPrivateState();
 };
 
-#endif
 
 void ExMasterStats::init()
 {
@@ -8710,11 +8493,7 @@ void ExMasterStats::init()
   queryType_ = SQL_OTHER;
   subqueryType_ = SQL_STMT_NA;
   statsErrorCode_ = 0;
-#ifndef __EID
   stmtState_ = Statement::INITIAL_;
-#else
-  stmtState_ = 0;
-#endif
   numCpus_ = 0;
   masterFlags_ = 0;
   parentQid_ = NULL;
@@ -9032,7 +8811,6 @@ void ExMasterStats::getVariableStatsInfo(char * dataBuffer,
     exeElapsedTime = exeEndTime_ - exeStartTime_;
   short stmtState = stmtState_;
 
-#ifndef __EID
   if (isQuerySuspended_)
     stmtState = Statement::SUSPENDED_;
   if ((Int32)getCollectStatsType() == SQLCLI_ET_OFFENDER_STATS)
@@ -9090,7 +8868,6 @@ void ExMasterStats::getVariableStatsInfo(char * dataBuffer,
               ((sourceStr_ != NULL) ? sourceStr_ : ""));
    }
    else
-#endif
    {
      str_sprintf(buf,"statsRowType: %d Qid: %s CompStartTime: %Ld "
     "CompEndTime: %Ld "
@@ -9277,7 +9054,6 @@ void ExMasterStats::fixup(ExMasterStats *other)
   *((Long  *)addrOfStatsVFTPtr) = *((Long *)myStatsVFTPtr);
 }
 
-#ifndef __EID
 Lng32 ExMasterStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
 {
   sqlStats_item->error_code = 0;
@@ -9536,7 +9312,6 @@ void ExMasterStats::setChildQid(char *queryId, Lng32 queryIdLen)
     childQidLen_ = queryIdLen;
   }
 }
-#endif
 
 void ExMasterStats::setCancelComment(char const* comment)
 {
@@ -9615,8 +9390,6 @@ Int32 ExMasterStats::timeSinceUnblocking(Int32 s)
   return r;
 }
 
-#ifndef __EID
-
 NABoolean ExMasterStats::filterForCpuStats(short subReqType, 
     Int64 currTimestamp, Lng32  etTimeInSecs)
 
@@ -10269,8 +10042,6 @@ Lng32 ExStatsTcb::str_parse_stmt_name(char *string, Lng32 len, char *nodeName,
   return retcode;
 }
 
-#endif
-
 NABoolean ExOperStatsId::compare(const ExOperStatsId &other, 
     ComTdb::CollectStatsType cst) const
 {
@@ -10290,7 +10061,6 @@ NABoolean ExOperStatsId::compare(const ExOperStatsId &other,
   }
 }
 
-#ifndef __EID
 ExRMSStats::ExRMSStats(NAHeap *heap)
   :ExOperStats(heap, RMS_STATS)
 {
@@ -10649,7 +10419,6 @@ Lng32 ExRMSStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
   }
   return 0;
 }
-#endif
 
 ExBMOStats::ExBMOStats(NAMemory *heap)
   :ExOperStats(heap, BMO_STATS)
@@ -10683,7 +10452,8 @@ ExBMOStats::ExBMOStats(NAMemory *heap, StatType statType,
 ExBMOStats::ExBMOStats(NAMemory *heap, 
 			 ex_tcb *tcb,
 			 const ComTdb * tdb)
-  :ExOperStats(heap, BMO_STATS, tcb, tdb)
+  : ExOperStats(heap, BMO_STATS, tcb, tdb)
+  , timer_(CLOCK_MONOTONIC)
 {
   init();
   spaceBufferSize_ = -1;
@@ -10700,8 +10470,6 @@ void ExBMOStats::init()
   bmoHeapUsage_ = 0;
   bmoHeapWM_ = 0;
   spaceBufferCount_ = 0;
-  overflowPhase_[0] = '\0';
-  overflowPhaseStartTime_ = -1;
   scratchFileCount_ = 0;
   scratchBufferBlockSize_ = -1;
   scratchBufferBlockRead_ = 0;
@@ -10709,6 +10477,7 @@ void ExBMOStats::init()
   scratchReadCount_ = 0;
   scratchWriteCount_ = 0;
   topN_ = -1;
+  timer_.reset();
 }
 
 UInt32 ExBMOStats::packedLength()
@@ -10801,9 +10570,9 @@ void ExBMOStats::getVariableStatsInfo(char * dataBuffer,
   str_sprintf (
        buf,
        "statsRowType: %d explainTdbId: %d bmoHeapUsed: %d bmoHeapTotal: %d bmoHeapWM: %d "
-       "bmoSpaceBufferSize: %d bmoSpaceBufferCount: %d OFPhase: %s OFPhaseStartTime: %Ld "
+       "bmoSpaceBufferSize: %d bmoSpaceBufferCount: %d "
        "scrOverFlowMode: %d scrFileCount: %d scrBufferBlockSize: %d scrBuffferRead: %d scrBufferWritten: %d "
-       "scrWriteCount: %Ld scrReadCount: %Ld topN: %Ld",
+       "scrWriteCount: %Ld scrReadCount: %Ld topN: %Ld scrIOTime: %Ld ",
         statType(),
         getExplainNodeId(),
         bmoHeapUsage_,
@@ -10811,8 +10580,6 @@ void ExBMOStats::getVariableStatsInfo(char * dataBuffer,
         bmoHeapWM_,
         spaceBufferSize_,
         spaceBufferCount_,
-        overflowPhase_,
-        overflowPhaseStartTime_,
         scratchOverflowMode_,
         scratchFileCount_,
         scratchBufferBlockSize_,
@@ -10820,7 +10587,8 @@ void ExBMOStats::getVariableStatsInfo(char * dataBuffer,
         scratchBufferBlockWritten_,
         scratchWriteCount_,
         scratchReadCount_,
-        topN_
+        topN_,
+        timer_.getTime()
        );
   buf += str_len(buf);
   *(short*)dataLen = (short) (buf - dataBuffer);
@@ -10834,15 +10602,13 @@ ExBMOStats *ExBMOStats::castToExBMOStats()
 void ExBMOStats::merge(ExBMOStats* other)
 {
   ExOperStats::merge(other);
+  timer_ = timer_ + other->timer_;
   bmoHeapUsage_ += other->bmoHeapUsage_;
   bmoHeapAlloc_ += other->bmoHeapAlloc_;
   bmoHeapWM_ += other->bmoHeapWM_;
   if (other->spaceBufferSize_ != -1)
     spaceBufferSize_ = other->spaceBufferSize_;
   spaceBufferCount_ += other->spaceBufferCount_;
-  if (other->overflowPhaseStartTime_ != -1)
-    overflowPhaseStartTime_ = other->overflowPhaseStartTime_;
-  str_cpy_all(overflowPhase_, other->overflowPhase_, str_len(other->overflowPhase_)+1);
   if (other->scratchBufferBlockSize_ != -1)
     scratchBufferBlockSize_ = other->scratchBufferBlockSize_;
   if (other->topN_ != -1)
@@ -10878,22 +10644,6 @@ Lng32 ExBMOStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
   case SQLSTATS_BMO_SPACE_BUFFER_COUNT:
     sqlStats_item->int64_value = spaceBufferCount_;
     break;
-  case SQLSTATS_OVEFLOW_PHASE_STARTTIME:
-    sqlStats_item->int64_value = overflowPhaseStartTime_;
-    break;
-  case SQLSTATS_OVERFLOW_PHASE:
-    if (sqlStats_item->str_value != NULL)
-    {
-      len = str_len(overflowPhase_);
-      if (len <= sqlStats_item->str_max_len)
-      {
-        str_cpy(sqlStats_item->str_value, overflowPhase_, len);
-        sqlStats_item->str_ret_len = len;
-      }
-      else
-        sqlStats_item->error_code = -EXE_ERROR_IN_STAT_ITEM;
-    }
-    break;
   case SQLSTATS_SCRATCH_OVERFLOW_MODE:
     sqlStats_item->int64_value = scratchOverflowMode_;
     break;
@@ -10918,6 +10668,9 @@ Lng32 ExBMOStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
   case SQLSTATS_SCRATCH_WRITE_COUNT:
     sqlStats_item->int64_value = scratchWriteCount_;
     break;
+  case SQLSTATS_SCRATCH_IO_TIME:
+    sqlStats_item->int64_value = timer_.getTime();
+    break;
   case SQLSTATS_DETAIL:
    if (sqlStats_item->str_value != NULL)
     {
@@ -10934,11 +10687,7 @@ Lng32 ExBMOStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
     }
     break;
   default:
-#ifndef __EID
     ExOperStats::getStatsItem(sqlStats_item);
-#else
-    sqlStats_item->error_code = -EXE_ERROR_IN_STAT_ITEM;
-#endif
     break;
   }
   return 0;
@@ -11140,11 +10889,7 @@ Lng32 ExUDRBaseStats::getStatsItem(SQLSTATS_ITEM* sqlStats_item)
       }
       break;
     default:
-#ifndef __EID
       ExOperStats::getStatsItem(sqlStats_item);
-#else
-      sqlStats_item->error_code = -EXE_ERROR_IN_STAT_ITEM;
-#endif
       break;
   }
   return 0;
@@ -11371,7 +11116,6 @@ ExProcessStats::ExProcessStats(NAMemory * heap)
   init();  
 }
 
-#ifndef __EID
 ExProcessStats::ExProcessStats(NAMemory * heap, 
                    short nid, pid_t pid)
   : ExOperStats(heap, PROCESS_STATS)
@@ -11387,7 +11131,6 @@ ExProcessStats::ExProcessStats(NAMemory * heap,
   numESPsFree_ = 0;
   init();
 }
-#endif
 
 void ExProcessStats::init()
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/executor/ExStats.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExStats.h b/core/sql/executor/ExStats.h
index edc3f1e..3f5c316 100644
--- a/core/sql/executor/ExStats.h
+++ b/core/sql/executor/ExStats.h
@@ -44,14 +44,12 @@
 #include "ComTdb.h"
 #include "ExScheduler.h"
 #include "ComTdbStats.h"
-#ifndef __EID
 #include "ComTdbUdr.h"
 #include "ComRtUtils.h"
 #include "Globals.h"
 #include "SqlStats.h"
 #include "ssmpipc.h"
 #include "ComCextdecs.h"
-#endif
 #include "ex_tcb.h"
 #include "ExMeas.h"
 #include "SQLCLIdev.h"
@@ -1003,9 +1001,7 @@ NA_EIDPROC
   virtual void getVariableStatsInfo(char * dataBuffer,
 				    char * datalen,
 				    Lng32 maxLen);
-#ifndef __EID
   virtual Lng32 getStatsItem(SQLSTATS_ITEM* sqlStats_item);
-#endif
 
 
 NA_EIDPROC
@@ -1181,12 +1177,6 @@ public:
   ExBMOStats *castToExBMOStats();
   void merge(ExBMOStats* other);
   Lng32 getStatsItem(SQLSTATS_ITEM* sqlStats_item);
-  inline void setOverflowPhaseStartTime(Int64 startTime) { overflowPhaseStartTime_ = startTime; }
-  inline void setOverflowPhase(char *phase) 
-  { 
-    short len = (short)str_len(phase);
-    str_cpy_all(overflowPhase_, phase, len+1);
-  }
   inline void setScratchBufferBlockSize(Int32 size) 
   { 
     scratchBufferBlockSize_ = size >> 10;
@@ -1217,14 +1207,14 @@ public:
   }
   inline Int64 getScratchReadCount(void) { return scratchReadCount_; }
   static const char *getScratchOverflowMode(Int16 overflowMode);
+  ExTimeStats &getScratchIOTimer() { return timer_; }
 private:
+  ExTimeStats timer_;
   Int32 bmoHeapAlloc_;
   Int32 bmoHeapUsage_;
   Int32 bmoHeapWM_;
   Int32 spaceBufferSize_;
   Int32 spaceBufferCount_;
-  char overflowPhase_[12];
-  Int64 overflowPhaseStartTime_;
   Int32 scratchFileCount_;
   Int32 scratchBufferBlockSize_;
   Int32 scratchBufferBlockRead_;
@@ -1291,7 +1281,6 @@ NA_EIDPROC
 
 NA_EIDPROC
   ExOperStats * copyOper(NAMemory * heap);
-#ifndef __EID
 /////////////////////////////////////////////////////////////////
 // accessors, mutators
 /////////////////////////////////////////////////////////////////
@@ -1302,8 +1291,6 @@ NA_EIDPROC
 NA_EIDPROC
   inline SB_Phandle_Type * getPhandlePtr()              { return &phandle_; }
 
-#endif
-
  NA_EIDPROC
    bool isFragSuspended() const { return isFragSuspended_; }
 
@@ -1327,11 +1314,10 @@ NA_EIDPROC
   inline void setCpuTime(Int64 cpuTime) { cpuTime_ = cpuTime; }
 
 NA_EIDPROC
-  inline Int64 getMaxSpaceUsage() const         { return maxSpaceUsage_; }
+  inline Int64 getMaxSpaceUsage() const         { return spaceUsage_; }
  
 NA_EIDPROC
-  inline Int64 getMaxHeapUsage() const          { return maxHeapUsage_; }
-#ifndef __EID
+  inline Int64 getMaxHeapUsage() const          { return heapUsage_; }
 NA_EIDPROC
   inline Lng32 getStmtIndex() const                  { return stmtIndex_; }
  
@@ -1343,29 +1329,15 @@ NA_EIDPROC
  
 NA_EIDPROC
   inline void setTimestamp(Int64 t)                    { timestamp_ = t; }
-#endif 
+
 NA_EIDPROC
    inline void updateSpaceUsage(Space *space, CollHeap *heap)
    {
-#ifdef __EID
-    Int32 currentSpaceUsage = (Int32)(space->getAllocSize() >> 10);
-    Int32 currentSpaceAlloc = (Int32)(space->getTotalSize() >> 10);
-    maxSpaceUsage_ = currentSpaceUsage - histMaxSpaceUsage_;
-    maxSpaceAlloc_ = currentSpaceAlloc - histMaxSpaceAlloc_;
-    histMaxSpaceUsage_ = currentSpaceUsage;
-    histMaxSpaceAlloc_ = currentSpaceAlloc;
-    Int32 currentHeapUsage = (Int32)(heap->getAllocSize() >> 10);
-    Int32 currentHeapAlloc = (Int32)(heap->getTotalSize() >> 10);
-    maxHeapUsage_ = currentHeapUsage - histMaxHeapUsage_;
-    maxHeapAlloc_ = currentHeapAlloc - histMaxHeapAlloc_;
-    histMaxHeapUsage_ = currentHeapUsage;
-    histMaxHeapAlloc_ = currentHeapAlloc;
-#else
-    maxSpaceUsage_ = (Int32)(space->getAllocSize() >> 10);
-    maxSpaceAlloc_ = (Int32)(space->getTotalSize() >> 10);
-    maxHeapUsage_ = (Int32)(heap->getAllocSize() >> 10);
-    maxHeapAlloc_ = (Int32)(heap->getTotalSize() >> 10);
-#endif
+    spaceUsage_ = (Int32)(space->getAllocSize() >> 10);
+    spaceAlloc_ = (Int32)(space->getTotalSize() >> 10);
+    heapUsage_ = (Int32)(heap->getAllocSize() >> 10);
+    heapAlloc_ = (Int32)(heap->getTotalSize() >> 10);
+    heapWM_ = (Int32)(heap->getHighWaterMark() >> 10);
    }
 
 NA_EIDPROC
@@ -1387,7 +1359,6 @@ NA_EIDPROC
 NA_EIDPROC
   void initHistory();
 
-#ifndef __EID
   Int32 getExecutionCount() const { return executionCount_; }
 
   inline Int32 getNewprocess()          { return newprocess_; }
@@ -1438,7 +1409,6 @@ NA_EIDPROC
        return waitTime_/ dop();
   }
   inline Int64 getMaxWaitTime() { return maxWaitTime_; }
-#endif
 
   NABoolean hdfsAccess()
     { return (flags_ & HDFS_ACCESS) != 0; }
@@ -1452,24 +1422,20 @@ private:
   };
 
   // some heap statistics for the entire fragment instance
-  Int32 maxSpaceUsage_;
-  Int32 maxSpaceAlloc_;
-  Int32 maxHeapUsage_;
-  Int32 maxHeapAlloc_;
+  Int32 spaceUsage_;
+  Int32 spaceAlloc_;
+  Int32 heapUsage_;
+  Int32 heapAlloc_;
+  Int32 heapWM_;
   Int64 cpuTime_;
   Int16 scratchOverflowMode_;
-#ifdef __EID
-  Int32 histMaxSpaceUsage_;
-  Int32 histMaxSpaceAlloc_;
-  Int32 histMaxHeapUsage_;
-  Int32 histMaxHeapAlloc_;
-#else
   Int32 newprocess_;
   Int64 newprocessTime_; 
-  Int32 espMaxSpaceUsage_;
-  Int32 espMaxSpaceAlloc_;
-  Int32 espMaxHeapUsage_;
-  Int32 espMaxHeapAlloc_;
+  Int32 espSpaceUsage_;
+  Int32 espSpaceAlloc_;
+  Int32 espHeapUsage_;
+  Int32 espHeapAlloc_;
+  Int32 espHeapWM_;
   Int64 espCpuTime_;
   Int64 histCpuTime_;
   Int64 reqMsgCnt_;
@@ -1495,7 +1461,6 @@ private:
   // process id of this fragment instance (to correlate it with MEASURE data)
   // Also used by logic on runtimestats/CancelBroker.cpp
   SB_Phandle_Type phandle_;
-#endif
   // This is aggregated only for the process.  It is never merged into or
   // from.
   Int64 localCpuTime_;
@@ -1504,11 +1469,9 @@ private:
   // stats global semaphore.  Read by master and ESP EXE without the
   // semaphore.
   bool isFragSuspended_;
-#ifndef __EID
   Int64 maxWaitTime_;
   Int64 waitTime_;
   Int64 diffCpuTime_;
-#endif
 
   Int32 flags_;
 };
@@ -1606,9 +1569,7 @@ inline void setOpenTime(Int64 t)    { openTime_ = t; }
 NA_EIDPROC
 inline void incOpenTime(Int64 t)    { openTime_ += t; }
 
-#ifndef __EID
   Lng32 getStatsItem(SQLSTATS_ITEM* sqlStats_item);
-#endif
 
 NA_EIDPROC
   virtual void getVariableStatsInfo(char * dataBuffer,
@@ -1927,10 +1888,8 @@ NA_EIDPROC
   inline void updIoSize(Int64 newSize)
   { ioSize_ = newSize ; }
 
-#ifndef __EID
   inline void incrClusterSplits() { clusterSplits_++; }
   inline void incrHashLoops() { hashLoops_++; }
-#endif
 
 private:
   ExTimeStats phaseTimes_[3];
@@ -2796,8 +2755,6 @@ NA_EIDPROC
 NA_EIDPROC
   inline void setCpuTime(Int64 cpuTime) { cpuTime_ = cpuTime; }
 
-
-#ifndef __EID
   Lng32 getStatsItem(SQLSTATS_ITEM* sqlStats_item);
   void setCpuStatsHistory() { histCpuTime_ = cpuTime_; }
   NABoolean filterForCpuStats();
@@ -2827,27 +2784,25 @@ NA_EIDPROC
   inline const short * getPhandle() const     { return phandle_; }
 #endif
 
-#endif
-  
 private:
 
   Int32 newprocess_;
   Int64 newprocessTime_; 
   Int32 timeouts_;
-
   Int32 numSorts_;
   Int64 sortElapsedTime_;
   // some heap statistics for the entire fragment instance
-  Int32 maxSpaceUsage_;
-  Int32 maxSpaceAlloc_;
-  Int32 maxHeapUsage_;
-  Int32 maxHeapAlloc_;
+  Int32 spaceUsage_;
+  Int32 spaceAlloc_;
+  Int32 heapUsage_;
+  Int32 heapAlloc_;
+  Int32 heapWM_;
   Int64 cpuTime_;
-#ifndef __EID
-  Int32 espMaxSpaceUsage_;
-  Int32 espMaxSpaceAlloc_;
-  Int32 espMaxHeapUsage_;
-  Int32 espMaxHeapAlloc_;
+  Int32 espSpaceUsage_;
+  Int32 espSpaceAlloc_;
+  Int32 espHeapUsage_;
+  Int32 espHeapAlloc_;
+  Int32 espHeapWM_;
   Int64 espCpuTime_;
   Int64 histCpuTime_;
   char *queryId_;
@@ -2866,12 +2821,6 @@ private:
   // on NSK systems, this is called a PHANDLE
   short phandle_[10];
 #endif // NA_LINUX
-#else
-  Int32 histMaxSpaceUsage_;
-  Int32 histMaxSpaceAlloc_;
-  Int32 histMaxHeapUsage_;
-  Int32 histMaxHeapAlloc_;
-#endif
   // Set to true and reset to false by the MXSSCP process under the
   // stats global semaphore.  Read by master and ESP EXE without the
   // semaphore.
@@ -2879,7 +2828,6 @@ private:
 
   Int64 localCpuTime_;
   Int16 scratchOverflowMode_;
-#ifndef __EID
   Int32 scratchFileCount_;
   Int32 scratchBufferBlockSize_;
   Int64 scratchBufferBlockRead_;
@@ -2888,7 +2836,6 @@ private:
   Int64 scratchWriteCount_;
   Int64 udrCpuTime_;
   Int64 topN_;
-#endif
 };
 
 
@@ -2924,18 +2871,14 @@ public:
   {
     replyMsgCnt_++;
     replyMsgBytes_ += msgBytes;
-#ifndef __EID
     recentReplyTS_ = NA_JulianTimestamp();
-#endif
   }
 
   void incReqMsg(Int64 msgBytes)
   {
     reqMsgCnt_++;
     reqMsgBytes_ += msgBytes;
-#ifndef __EID
     recentReqTS_ = NA_JulianTimestamp();
-#endif
   }
 
 private:
@@ -3183,7 +3126,6 @@ NA_EIDPROC
 NA_EIDPROC
   void unpackSmallObjFromEid(IpcConstMessageBufferPtr buffer,
 			     Lng32 version = _STATS_PRE_RTS_VERSION);
-#ifndef __EID
 
 NA_EIDPROC
   Int64 getExplainPlanId() const { return explainPlanId_; }
@@ -3191,8 +3133,6 @@ NA_EIDPROC
 NA_EIDPROC
   void setExplainPlanId(Int64 pid) { explainPlanId_ = pid; }
 
-#endif
-
 NA_EIDPROC
   ComTdb::CollectStatsType getCollectStatsType() { return (ComTdb::CollectStatsType)collectStatsType_; };
 NA_EIDPROC
@@ -3294,7 +3234,6 @@ NA_EIDPROC
   {
     rootStats_ = root;
   }
-#ifndef __EID
   Lng32 getStatsItems(Lng32 no_of_stats_items,
 	    SQLSTATS_ITEM sqlStats_items[]);
   Lng32 getStatsDesc(short *statsCollectType,
@@ -3324,7 +3263,6 @@ NA_EIDPROC
   void setSubReqType(short subReqType) { subReqType_ = subReqType; }
   short getSubReqType() { return subReqType_; }
   void setQueryId(char *queryId, Lng32 queryIdLen);
-#endif
 NA_EIDPROC
   Int64 getHashData(ExOperStats::StatType type,
                                      Lng32 tdbId);
@@ -3358,13 +3296,11 @@ NA_EIDPROC
     RTS_STATS_COLLECT_ENABLED = 0x0002
   };
 
-#ifndef __EID
 NA_EIDPROC
   IDInfo * IDLookup(HashQueue * hq, Int64 id);
 
 NA_EIDPROC
   void preProcessStats();
-#endif
 
   NAMemory * heap_;
   HashQueue * entries_;
@@ -3429,7 +3365,6 @@ public:
 };
 
 
-#ifndef __EID
 // -----------------------------------------------------------------------
 // ExStatsTdb
 // -----------------------------------------------------------------------
@@ -3510,12 +3445,10 @@ public:
   Lng32 parse_stmt_name(char *string, Lng32 len);
   ComDiagsArea * getDiagsArea() { return diagsArea_; }
   
-#ifndef __EID
   Lng32 str_parse_stmt_name(char *string, Lng32 len, char *nodeName, short *cpu,       pid_t *pid,Int64 *timeStamp, Lng32 *queryNumber,
        short *qidOffset, short *qidLen, short *activeQueryNum, 
        UInt16 *statsMergeType, short *detailLevel, short *subReqType, 
        Lng32 *filterTimeInSecs);
-#endif
   enum StatsStep
   {
     INITIAL_, GET_NEXT_STATS_ENTRY_, APPLY_SCAN_EXPR_, PROJECT_, ERROR_, DONE_, SEND_TO_SSMP_,
@@ -3595,8 +3528,6 @@ private:
 };
 
 
-#endif
-
 //////////////////////////////////////////////////////////////////
 // class ExMasterStats
 //////////////////////////////////////////////////////////////////
@@ -3865,7 +3796,6 @@ NA_EIDPROC
   void initBeforeExecute(Int64 currentTimestamp);
   void resetAqrInfo();
 
-#ifndef __EID
   Lng32 getStatsItem(SQLSTATS_ITEM* sqlStats_item);
   void setParentQid(char *queryId, Lng32 queryIdLen);
   char *getParentQid() { return parentQid_; }
@@ -3881,25 +3811,21 @@ NA_EIDPROC
   void incReclaimSpaceCount() { reclaimSpaceCount_++; }
   NABoolean filterForCpuStats(short subReqType, Int64 currTimestamp, 
                 Lng32  etTimeInSecs);
-#endif
-
   Int64 getRowsReturned() const { return rowsReturned_; }
   void setRowsReturned(Int64 cnt) { rowsReturned_ = cnt; }
   void incRowsReturned(Int64 i = 1)
-  { rowsReturned_ += i;
-#ifndef __EID
+  { 
+    rowsReturned_ += i;
     if (firstRowReturnTime_ == -1)
       firstRowReturnTime_ = NA_JulianTimestamp();
-#endif
   }
 
   bool isQuerySuspended() const { return isQuerySuspended_; }
   void setQuerySuspended(bool s) 
-    { isQuerySuspended_ = s;
-#ifndef __EID 
+    { 
+      isQuerySuspended_ = s;
       if (isQuerySuspended_) 
         querySuspendedTime_ = NA_JulianTimestamp();
-#endif
     }
   Int64 getQuerySuspendedTime() const { return querySuspendedTime_; }
   char *getCancelComment() const { return cancelComment_; }
@@ -4030,8 +3956,6 @@ private:
 
 
 
-#ifndef __EID
- 
 class ExRMSStats : public ExOperStats
 {
 public:
@@ -4141,9 +4065,6 @@ private:
   Int32 numQueryInvKeys_;
   short nodesInCluster_;
 };
-#endif
-
-
 
 
 //////////////////////////////////////////////////////////////////
@@ -4261,11 +4182,8 @@ private:
 class ExProcessStats : public ExOperStats {
 public:
   ExProcessStats(NAMemory * heap);
-#ifndef __EID
   ExProcessStats(NAMemory * heap, 
                    short nid, pid_t pid);
-#endif
-
   ~ExProcessStats()
   {
      if (delQid_)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/generator/GenRelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelExeUtil.cpp b/core/sql/generator/GenRelExeUtil.cpp
index 9e70bc5..a0c4c65 100644
--- a/core/sql/generator/GenRelExeUtil.cpp
+++ b/core/sql/generator/GenRelExeUtil.cpp
@@ -1190,7 +1190,7 @@ short ExeUtilGetStatistics::codeGen(Generator * generator)
   exe_util_tdb->setOldFormat(oldFormat_);
   exe_util_tdb->setShortFormat(shortFormat_);
   exe_util_tdb->setTokenizedFormat(tokenizedFormat_);
-
+  exe_util_tdb->setSingleLineFormat(singleLineFormat_);
   if(!generator->explainDisabled()) {
     generator->setExplainTuple(
        addExplainInfo(exe_util_tdb, 0, 0, generator));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp
index e439258..fd398dc 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -591,6 +591,7 @@ ExeUtilGetStatistics::ExeUtilGetStatistics(NAString statementName,
        errorInParams_(FALSE),
        statsReqType_(statsReqType),
        statsMergeType_(statsMergeType),
+       singleLineFormat_(FALSE),
        activeQueryNum_(activeQueryNum)
 {
   NABoolean explicitStatsOption = FALSE;
@@ -645,10 +646,10 @@ ExeUtilGetStatistics::ExeUtilGetStatistics(NAString statementName,
 	  else if (option == "TF")
 	    tokenizedFormat_ = TRUE;
 	  else if (option == "NC")
-	  {
             shortFormat_ = TRUE;
-	  }
-	  else
+	  else if (option == "SL")
+            singleLineFormat_ = TRUE;
+          else 
 	    {
 	      errorInParams_ = TRUE;
 	      return;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/optimizer/RelExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.h b/core/sql/optimizer/RelExeUtil.h
index 1e7ef4c..3445ee6 100644
--- a/core/sql/optimizer/RelExeUtil.h
+++ b/core/sql/optimizer/RelExeUtil.h
@@ -1553,6 +1553,7 @@ protected:
   // ds: Detailed Stats
   // of: old format (mxci display statistics output)
   // tf: tokenized format, each stats value preceded by a predefined token.
+  // sl: A single line report of BMO and PERTABLE stats
   NAString optionsStr_;
 
   NABoolean compilerStats_;
@@ -1569,6 +1570,7 @@ protected:
   short statsReqType_;
   short statsMergeType_;
   short activeQueryNum_;
+  NABoolean singleLineFormat_;
 };
 
 class ExeUtilGetProcessStatistics : public ExeUtilGetStatistics

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index d70ef95..c13121d 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -15304,14 +15304,14 @@ exe_util_get_statistics : TOK_GET TOK_STATISTICS stats_merge_clause get_statisti
 
 		 $$ = stats;
 	       }
-              | TOK_GET TOK_STATISTICS TOK_FOR TOK_QID qid_identifier stats_merge_clause
+              | TOK_GET TOK_STATISTICS TOK_FOR TOK_QID qid_identifier stats_merge_clause get_statistics_optional_options
                 {
                   ExeUtilGetStatistics *stats = NULL;
                   if (*$5 == "CURRENT")
                   {
                      stats =
                       new (PARSERHEAP ()) ExeUtilGetStatistics
-                    (*$5, NULL,
+                    (*$5, ($7 ? (char*)$7->data() : NULL),
                       PARSERHEAP (), SQLCLI_STATS_REQ_QID_CURRENT, (short)$6, -1); /*RtsQueryId::ANY_QUERY_*/
                   }
                   else


[2/6] incubator-trafodion git commit: [TRAFODION-2420] RMS enhancements Introduced 2 new counters HeapWM: - "SQL Heap WM" - Tracks the high water mark of the used memory including space buffer and bmo operator memory. It is enough to moni

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae3eca8a/core/sql/regress/core/EXPECTEDRTS
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTEDRTS b/core/sql/regress/core/EXPECTEDRTS
index c75fae3..fe5637c 100755
--- a/core/sql/regress/core/EXPECTEDRTS
+++ b/core/sql/regress/core/EXPECTEDRTS
@@ -56,10 +56,10 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 --- SQL operation complete.
 >>log LOGRTS;
 >>get statistics for qid current ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -94,11 +94,11 @@ Stats Collection Type    ACCUMULATED_STATS
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_303_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_579_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -129,11 +129,11 @@ Last Suspend Time        -1
 Stats Collection Type    ACCUMULATED_STATS
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_303_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_579_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -166,10 +166,10 @@ Stats Collection Type    ACCUMULATED_STATS
 --- SQL operation complete.
 >>log;
 >>display statistics for qid current;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -201,10 +201,10 @@ Stats Collection Type    ACCUMULATED_STATS
 
 --- SQL operation complete.
 >>get statistics for qid current ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -250,14 +250,14 @@ D
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_303_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
-Execute Start Time       2017/02/16 01:02:48.212804
-Execute End Time         2017/02/16 01:02:51.350916
-Execute Elapsed Time                 0:00:03.138112
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_579_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
+Execute Start Time       2017/03/27 22:19:42.133178
+Execute End Time         2017/03/27 22:19:45.435236
+Execute Elapsed Time                 0:00:03.302058
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -275,7 +275,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:02:51.349044
+First Row Returned Time  2017/03/27 22:19:45.433580
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -287,19 +287,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           708,700
-SQL Process Busy Time    4,139,515
+SE IO MAX Time           629,822
+SQL Process Busy Time    4,375,392
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            16                        KB
+SQL Heap Allocated       10,471                    KB
+SQL Heap Used            80                        KB
+SQL Heap WM              67                        KB
 Processes Created        2
-Process Create Time      120,844
+Process Create Time      150,199
 Request Message Count    26
 Request Message Bytes    39,392
-Reply Message Count      14
-Reply Message Bytes      32,184
+Reply Message Count      15
+Reply Message Bytes      38,760
 Scr. Overflow Mode       DISK
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -309,14 +310,14 @@ Scr. Read Count          0
 Scr. Write Count         0
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_303_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
-Execute Start Time       2017/02/16 01:02:48.212804
-Execute End Time         2017/02/16 01:02:51.350916
-Execute Elapsed Time                 0:00:03.138112
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_579_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
+Execute Start Time       2017/03/27 22:19:42.133178
+Execute End Time         2017/03/27 22:19:45.435236
+Execute Elapsed Time                 0:00:03.302058
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -334,7 +335,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:02:51.349044
+First Row Returned Time  2017/03/27 22:19:45.433580
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -346,19 +347,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           708,700
-SQL Process Busy Time    4,139,515
+SE IO MAX Time           629,822
+SQL Process Busy Time    4,375,392
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            16                        KB
+SQL Heap Allocated       10,471                    KB
+SQL Heap Used            80                        KB
+SQL Heap WM              67                        KB
 Processes Created        2
-Process Create Time      120,844
+Process Create Time      150,199
 Request Message Count    26
 Request Message Bytes    39,392
-Reply Message Count      14
-Reply Message Bytes      32,184
+Reply Message Count      15
+Reply Message Bytes      38,760
 Scr. Overflow Mode       DISK
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -370,13 +372,13 @@ Scr. Write Count         0
 --- SQL operation complete.
 >>log;
 >>display statistics for qid current;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
-Execute Start Time       2017/02/16 01:02:48.212804
-Execute End Time         2017/02/16 01:02:51.350916
-Execute Elapsed Time                 0:00:03.138112
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
+Execute Start Time       2017/03/27 22:19:42.133178
+Execute End Time         2017/03/27 22:19:45.435236
+Execute Elapsed Time                 0:00:03.302058
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -394,7 +396,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:02:51.349044
+First Row Returned Time  2017/03/27 22:19:45.433580
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -406,19 +408,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           708,700
-SQL Process Busy Time    4,139,515
+SE IO MAX Time           629,822
+SQL Process Busy Time    4,375,392
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            16                        KB
+SQL Heap Allocated       10,471                    KB
+SQL Heap Used            80                        KB
+SQL Heap WM              67                        KB
 Processes Created        2
-Process Create Time      120,844
+Process Create Time      150,199
 Request Message Count    26
 Request Message Bytes    39,392
-Reply Message Count      14
-Reply Message Bytes      32,184
+Reply Message Count      15
+Reply Message Bytes      38,760
 Scr. Overflow Mode       DISK
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -429,13 +432,13 @@ Scr. Write Count         0
 
 --- SQL operation complete.
 >>get statistics for qid current ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_303_S1
-Compile Start Time       2017/02/16 01:02:45.193696
-Compile End Time         2017/02/16 01:02:45.225119
-Compile Elapsed Time                 0:00:00.031423
-Execute Start Time       2017/02/16 01:02:48.212804
-Execute End Time         2017/02/16 01:02:51.350916
-Execute Elapsed Time                 0:00:03.138112
+Qid                      MXID11000006521212357413143091999000000000206U3333300_579_S1
+Compile Start Time       2017/03/27 22:19:35.703280
+Compile End Time         2017/03/27 22:19:35.732216
+Compile Elapsed Time                 0:00:00.028936
+Execute Start Time       2017/03/27 22:19:42.133178
+Execute End Time         2017/03/27 22:19:45.435236
+Execute Elapsed Time                 0:00:03.302058
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -453,7 +456,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:02:51.349044
+First Row Returned Time  2017/03/27 22:19:45.433580
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -465,19 +468,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           708,700
-SQL Process Busy Time    4,139,515
+SE IO MAX Time           629,822
+SQL Process Busy Time    4,375,392
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            16                        KB
+SQL Heap Allocated       10,471                    KB
+SQL Heap Used            80                        KB
+SQL Heap WM              67                        KB
 Processes Created        2
-Process Create Time      120,844
+Process Create Time      150,199
 Request Message Count    26
 Request Message Bytes    39,392
-Reply Message Count      14
-Reply Message Bytes      32,184
+Reply Message Count      15
+Reply Message Bytes      38,760
 Scr. Overflow Mode       DISK
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -494,25 +498,25 @@ Scr. Write Count         0
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_303_S1 ;
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_579_S1 ;
 
-*** ERROR[8923] The given Query Id MXID11000027092212353966950645999000000000206U3333300_303_S1 is not found.
+*** ERROR[8923] The given Query Id MXID11000006521212357413143091999000000000206U3333300_579_S1 is not found.
 
 --- SQL operation failed with errors.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_303_S1 ;
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_579_S1 ;
 
-*** ERROR[8923] The given Query Id MXID11000027092212353966950645999000000000206U3333300_303_S1 is not found.
+*** ERROR[8923] The given Query Id MXID11000006521212357413143091999000000000206U3333300_579_S1 is not found.
 
 --- SQL operation failed with errors.
 >>log;
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_312_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_312_S1
-Compile Start Time       2017/02/16 01:02:54.344766
-Compile End Time         2017/02/16 01:02:54.345294
-Compile Elapsed Time                 0:00:00.000528
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_588_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_588_S1
+Compile Start Time       2017/03/27 22:19:51.734901
+Compile End Time         2017/03/27 22:19:51.735427
+Compile Elapsed Time                 0:00:00.000526
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -543,11 +547,11 @@ Last Suspend Time        -1
 Stats Collection Type    ACCUMULATED_STATS
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_312_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_312_S1
-Compile Start Time       2017/02/16 01:02:54.344766
-Compile End Time         2017/02/16 01:02:54.345294
-Compile Elapsed Time                 0:00:00.000528
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_588_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_588_S1
+Compile Start Time       2017/03/27 22:19:51.734901
+Compile End Time         2017/03/27 22:19:51.735427
+Compile Elapsed Time                 0:00:00.000526
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -580,10 +584,10 @@ Stats Collection Type    ACCUMULATED_STATS
 --- SQL operation complete.
 >>log;
 >>display statistics for qid current;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_312_S1
-Compile Start Time       2017/02/16 01:02:54.344766
-Compile End Time         2017/02/16 01:02:54.345294
-Compile Elapsed Time                 0:00:00.000528
+Qid                      MXID11000006521212357413143091999000000000206U3333300_588_S1
+Compile Start Time       2017/03/27 22:19:51.734901
+Compile End Time         2017/03/27 22:19:51.735427
+Compile Elapsed Time                 0:00:00.000526
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -615,10 +619,10 @@ Stats Collection Type    ACCUMULATED_STATS
 
 --- SQL operation complete.
 >>get statistics for qid current ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_312_S1
-Compile Start Time       2017/02/16 01:02:54.344766
-Compile End Time         2017/02/16 01:02:54.345294
-Compile Elapsed Time                 0:00:00.000528
+Qid                      MXID11000006521212357413143091999000000000206U3333300_588_S1
+Compile Start Time       2017/03/27 22:19:51.734901
+Compile End Time         2017/03/27 22:19:51.735427
+Compile Elapsed Time                 0:00:00.000526
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -662,10 +666,10 @@ Stats Collection Type    ACCUMULATED_STATS
 --- SQL command prepared.
 >>log;
 >>get statistics for qid current ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -700,11 +704,11 @@ Stats Collection Type    PERTABLE_STATS
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_317_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_593_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -735,11 +739,11 @@ Last Suspend Time        -1
 Stats Collection Type    PERTABLE_STATS
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_317_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_593_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -774,11 +778,11 @@ Stats Collection Type    PERTABLE_STATS
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_317_S1 ACCUMULATED;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_593_S1 ACCUMULATED;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -809,11 +813,11 @@ Last Suspend Time        -1
 Stats Collection Type    PERTABLE_STATS
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_317_S1 ACCUMULATED;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_593_S1 ACCUMULATED;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -846,10 +850,10 @@ Stats Collection Type    PERTABLE_STATS
 --- SQL operation complete.
 >>log;
 >>display statistics for qid current;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -881,10 +885,10 @@ Stats Collection Type    PERTABLE_STATS
 
 --- SQL operation complete.
 >>get statistics for qid current ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -916,10 +920,10 @@ Stats Collection Type    PERTABLE_STATS
 
 --- SQL operation complete.
 >>display statistics for qid current accumulated ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -951,10 +955,10 @@ Stats Collection Type    PERTABLE_STATS
 
 --- SQL operation complete.
 >>get statistics for qid current accumulated ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -1000,14 +1004,14 @@ D
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_317_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
-Execute Start Time       2017/02/16 01:03:06.512541
-Execute End Time         2017/02/16 01:03:06.522982
-Execute Elapsed Time                 0:00:00.010441
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_593_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
+Execute Start Time       2017/03/27 22:20:08.312378
+Execute End Time         2017/03/27 22:20:08.325384
+Execute Elapsed Time                 0:00:00.013006
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1025,7 +1029,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:06.521253
+First Row Returned Time  2017/03/27 22:20:08.321228
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1033,20 +1037,21 @@ No. of times reclaimed   0
 Cancel Time              -1
 Last Suspend Time        -1
 Stats Collection Type    PERTABLE_STATS
-SQL Process Busy Time    6,176
+SQL Process Busy Time    5,901
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,338                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    27
 Request Message Bytes    39,552
-Reply Message Count      14
-Reply Message Bytes      32,568
+Reply Message Count      15
+Reply Message Bytes      39,144
 Scr. Overflow Mode       UNKNOWN
-Scr File Count           0
+Scr. File Count          0
 Scr. Buffer Blk Size     0
 Scr. Buffer Blks Read    0
 Scr. Buffer Blks Written 0
@@ -1054,22 +1059,22 @@ Scr. Read Count          0
 Scr. Write Count         0
 Sort TopN                -1
 
-Table Name
+       ID       DOP         Table Name
    Records Accessed       Records Used   HBase/Hive   HBase/Hive      HBase/Hive IO      HBase/Hive IO
    Estimated/Actual   Estimated/Actual          IOs    IO MBytes           Sum Time           Max Time
-TRAFODION.SCH.TSTAT
+        1         6   TRAFODION.SCH.TSTAT
                   0                100
-                  4                  4            4            0              4,755              2,404
+                  4                  4            4            0              4,678              2,488
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_317_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
-Execute Start Time       2017/02/16 01:03:06.512541
-Execute End Time         2017/02/16 01:03:06.522982
-Execute Elapsed Time                 0:00:00.010441
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_593_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
+Execute Start Time       2017/03/27 22:20:08.312378
+Execute End Time         2017/03/27 22:20:08.325384
+Execute Elapsed Time                 0:00:00.013006
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1087,7 +1092,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:06.521253
+First Row Returned Time  2017/03/27 22:20:08.321228
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1095,20 +1100,21 @@ No. of times reclaimed   0
 Cancel Time              -1
 Last Suspend Time        -1
 Stats Collection Type    PERTABLE_STATS
-SQL Process Busy Time    6,176
+SQL Process Busy Time    5,901
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,338                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    27
 Request Message Bytes    39,552
-Reply Message Count      14
-Reply Message Bytes      32,568
+Reply Message Count      15
+Reply Message Bytes      39,144
 Scr. Overflow Mode       UNKNOWN
-Scr File Count           0
+Scr. File Count          0
 Scr. Buffer Blk Size     0
 Scr. Buffer Blks Read    0
 Scr. Buffer Blks Written 0
@@ -1116,26 +1122,26 @@ Scr. Read Count          0
 Scr. Write Count         0
 Sort TopN                -1
 
-Table Name
+       ID       DOP         Table Name
    Records Accessed       Records Used   HBase/Hive   HBase/Hive      HBase/Hive IO      HBase/Hive IO
    Estimated/Actual   Estimated/Actual          IOs    IO MBytes           Sum Time           Max Time
-TRAFODION.SCH.TSTAT
+        1         6   TRAFODION.SCH.TSTAT
                   0                100
-                  4                  4            4            0              4,755              2,404
+                  4                  4            4            0              4,678              2,488
 
 --- SQL operation complete.
 >>log;
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_317_S1 ACCUMULATED;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
-Execute Start Time       2017/02/16 01:03:06.512541
-Execute End Time         2017/02/16 01:03:06.522982
-Execute Elapsed Time                 0:00:00.010441
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_593_S1 ACCUMULATED;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
+Execute Start Time       2017/03/27 22:20:08.312378
+Execute End Time         2017/03/27 22:20:08.325384
+Execute Elapsed Time                 0:00:00.013006
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1153,7 +1159,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:06.521253
+First Row Returned Time  2017/03/27 22:20:08.321228
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1165,19 +1171,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           2,404
-SQL Process Busy Time    6,176
+SE IO MAX Time           2,488
+SQL Process Busy Time    5,901
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,338                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    27
 Request Message Bytes    39,552
-Reply Message Count      14
-Reply Message Bytes      32,568
+Reply Message Count      15
+Reply Message Bytes      39,144
 Scr. Overflow Mode       UNKNOWN
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -1187,14 +1194,14 @@ Scr. Read Count          0
 Scr. Write Count         0
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_317_S1 ACCUMULATED;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
-Execute Start Time       2017/02/16 01:03:06.512541
-Execute End Time         2017/02/16 01:03:06.522982
-Execute Elapsed Time                 0:00:00.010441
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_593_S1 ACCUMULATED;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
+Execute Start Time       2017/03/27 22:20:08.312378
+Execute End Time         2017/03/27 22:20:08.325384
+Execute Elapsed Time                 0:00:00.013006
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1212,7 +1219,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:06.521253
+First Row Returned Time  2017/03/27 22:20:08.321228
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1224,19 +1231,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           2,404
-SQL Process Busy Time    6,176
+SE IO MAX Time           2,488
+SQL Process Busy Time    5,901
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,338                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    27
 Request Message Bytes    39,552
-Reply Message Count      14
-Reply Message Bytes      32,568
+Reply Message Count      15
+Reply Message Bytes      39,144
 Scr. Overflow Mode       UNKNOWN
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -1248,13 +1256,13 @@ Scr. Write Count         0
 --- SQL operation complete.
 >>log;
 >>display statistics for qid current;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
-Execute Start Time       2017/02/16 01:03:06.512541
-Execute End Time         2017/02/16 01:03:06.522982
-Execute Elapsed Time                 0:00:00.010441
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
+Execute Start Time       2017/03/27 22:20:08.312378
+Execute End Time         2017/03/27 22:20:08.325384
+Execute Elapsed Time                 0:00:00.013006
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1272,7 +1280,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:06.521253
+First Row Returned Time  2017/03/27 22:20:08.321228
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1280,20 +1288,21 @@ No. of times reclaimed   0
 Cancel Time              -1
 Last Suspend Time        -1
 Stats Collection Type    PERTABLE_STATS
-SQL Process Busy Time    6,176
+SQL Process Busy Time    5,901
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,338                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    27
 Request Message Bytes    39,552
-Reply Message Count      14
-Reply Message Bytes      32,568
+Reply Message Count      15
+Reply Message Bytes      39,144
 Scr. Overflow Mode       UNKNOWN
-Scr File Count           0
+Scr. File Count          0
 Scr. Buffer Blk Size     0
 Scr. Buffer Blks Read    0
 Scr. Buffer Blks Written 0
@@ -1301,22 +1310,22 @@ Scr. Read Count          0
 Scr. Write Count         0
 Sort TopN                -1
 
-Table Name
+       ID       DOP         Table Name
    Records Accessed       Records Used   HBase/Hive   HBase/Hive      HBase/Hive IO      HBase/Hive IO
    Estimated/Actual   Estimated/Actual          IOs    IO MBytes           Sum Time           Max Time
-TRAFODION.SCH.TSTAT
+        1         2   TRAFODION.SCH.TSTAT
                   0                100
-                  4                  4            4            0              4,755              2,404
+                  4                  4            4            0              4,678              2,488
 
 --- SQL operation complete.
 >>get statistics for qid current ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
-Execute Start Time       2017/02/16 01:03:06.512541
-Execute End Time         2017/02/16 01:03:06.522982
-Execute Elapsed Time                 0:00:00.010441
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
+Execute Start Time       2017/03/27 22:20:08.312378
+Execute End Time         2017/03/27 22:20:08.325384
+Execute Elapsed Time                 0:00:00.013006
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1334,7 +1343,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:06.521253
+First Row Returned Time  2017/03/27 22:20:08.321228
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1342,20 +1351,21 @@ No. of times reclaimed   0
 Cancel Time              -1
 Last Suspend Time        -1
 Stats Collection Type    PERTABLE_STATS
-SQL Process Busy Time    6,176
+SQL Process Busy Time    5,901
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,338                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    27
 Request Message Bytes    39,552
-Reply Message Count      14
-Reply Message Bytes      32,568
+Reply Message Count      15
+Reply Message Bytes      39,144
 Scr. Overflow Mode       UNKNOWN
-Scr File Count           0
+Scr. File Count          0
 Scr. Buffer Blk Size     0
 Scr. Buffer Blks Read    0
 Scr. Buffer Blks Written 0
@@ -1363,22 +1373,22 @@ Scr. Read Count          0
 Scr. Write Count         0
 Sort TopN                -1
 
-Table Name
+       ID       DOP         Table Name
    Records Accessed       Records Used   HBase/Hive   HBase/Hive      HBase/Hive IO      HBase/Hive IO
    Estimated/Actual   Estimated/Actual          IOs    IO MBytes           Sum Time           Max Time
-TRAFODION.SCH.TSTAT
+        1         2   TRAFODION.SCH.TSTAT
                   0                100
-                  4                  4            4            0              4,755              2,404
+                  4                  4            4            0              4,678              2,488
 
 --- SQL operation complete.
 >>display statistics for qid current accumulated;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
-Execute Start Time       2017/02/16 01:03:06.512541
-Execute End Time         2017/02/16 01:03:06.522982
-Execute Elapsed Time                 0:00:00.010441
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
+Execute Start Time       2017/03/27 22:20:08.312378
+Execute End Time         2017/03/27 22:20:08.325384
+Execute Elapsed Time                 0:00:00.013006
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1396,7 +1406,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:06.521253
+First Row Returned Time  2017/03/27 22:20:08.321228
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1408,19 +1418,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           2,404
-SQL Process Busy Time    6,176
+SE IO MAX Time           2,488
+SQL Process Busy Time    5,901
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,338                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    27
 Request Message Bytes    39,552
-Reply Message Count      14
-Reply Message Bytes      32,568
+Reply Message Count      15
+Reply Message Bytes      39,144
 Scr. Overflow Mode       UNKNOWN
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -1431,13 +1442,13 @@ Scr. Write Count         0
 
 --- SQL operation complete.
 >>get statistics for qid current accumulated;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_317_S1
-Compile Start Time       2017/02/16 01:03:00.271828
-Compile End Time         2017/02/16 01:03:00.308827
-Compile Elapsed Time                 0:00:00.036999
-Execute Start Time       2017/02/16 01:03:06.512541
-Execute End Time         2017/02/16 01:03:06.522982
-Execute Elapsed Time                 0:00:00.010441
+Qid                      MXID11000006521212357413143091999000000000206U3333300_593_S1
+Compile Start Time       2017/03/27 22:19:58.421877
+Compile End Time         2017/03/27 22:19:58.458982
+Compile Elapsed Time                 0:00:00.037105
+Execute Start Time       2017/03/27 22:20:08.312378
+Execute End Time         2017/03/27 22:20:08.325384
+Execute Elapsed Time                 0:00:00.013006
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1455,7 +1466,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:06.521253
+First Row Returned Time  2017/03/27 22:20:08.321228
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1467,19 +1478,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           2,404
-SQL Process Busy Time    6,176
+SE IO MAX Time           2,488
+SQL Process Busy Time    5,901
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,338                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    27
 Request Message Bytes    39,552
-Reply Message Count      14
-Reply Message Bytes      32,568
+Reply Message Count      15
+Reply Message Bytes      39,144
 Scr. Overflow Mode       UNKNOWN
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -1491,7 +1503,7 @@ Scr. Write Count         0
 --- SQL operation complete.
 >>log;
 >>obey PQIDOUT;
->>SET SESSION DEFAULT PARENT_QID 'MXID11000027092212353966950645999000000000206U3333300_317_S1';
+>>SET SESSION DEFAULT PARENT_QID 'MXID11000006521212357413143091999000000000206U3333300_593_S1';
 
 --- SQL operation complete.
 >>prepare s1 from select distinct d from tstat ;
@@ -1501,11 +1513,11 @@ Scr. Write Count         0
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_331_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_331_S1
-Compile Start Time       2017/02/16 01:03:16.005126
-Compile End Time         2017/02/16 01:03:16.005736
-Compile Elapsed Time                 0:00:00.000610
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_607_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_607_S1
+Compile Start Time       2017/03/27 22:20:15.172278
+Compile End Time         2017/03/27 22:20:15.172724
+Compile Elapsed Time                 0:00:00.000446
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -1517,7 +1529,7 @@ Query Type               SQL_SELECT_NON_UNIQUE
 Sub Query Type           SQL_STMT_NA
 Estimated Accessed Rows  0
 Estimated Used Rows      0
-Parent Qid               MXID11000027092212353966950645999000000000206U3333300_317_S1
+Parent Qid               MXID11000006521212357413143091999000000000206U3333300_593_S1
 Parent Query System      SAME
 Child Qid                NONE
 Number of SQL Processes  1
@@ -1536,11 +1548,11 @@ Last Suspend Time        -1
 Stats Collection Type    PERTABLE_STATS
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_331_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_331_S1
-Compile Start Time       2017/02/16 01:03:16.005126
-Compile End Time         2017/02/16 01:03:16.005736
-Compile Elapsed Time                 0:00:00.000610
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_607_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_607_S1
+Compile Start Time       2017/03/27 22:20:15.172278
+Compile End Time         2017/03/27 22:20:15.172724
+Compile Elapsed Time                 0:00:00.000446
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -1552,7 +1564,7 @@ Query Type               SQL_SELECT_NON_UNIQUE
 Sub Query Type           SQL_STMT_NA
 Estimated Accessed Rows  0
 Estimated Used Rows      0
-Parent Qid               MXID11000027092212353966950645999000000000206U3333300_317_S1
+Parent Qid               MXID11000006521212357413143091999000000000206U3333300_593_S1
 Parent Query System      SAME
 Child Qid                NONE
 Number of SQL Processes  1
@@ -1582,11 +1594,11 @@ Stats Collection Type    PERTABLE_STATS
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_333_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_333_S1
-Compile Start Time       2017/02/16 01:03:19.022446
-Compile End Time         2017/02/16 01:03:19.022986
-Compile Elapsed Time                 0:00:00.000540
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_609_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_609_S1
+Compile Start Time       2017/03/27 22:20:18.505298
+Compile End Time         2017/03/27 22:20:18.505902
+Compile Elapsed Time                 0:00:00.000604
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -1617,11 +1629,11 @@ Last Suspend Time        -1
 Stats Collection Type    PERTABLE_STATS
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_333_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_333_S1
-Compile Start Time       2017/02/16 01:03:19.022446
-Compile End Time         2017/02/16 01:03:19.022986
-Compile Elapsed Time                 0:00:00.000540
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_609_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_609_S1
+Compile Start Time       2017/03/27 22:20:18.505298
+Compile End Time         2017/03/27 22:20:18.505902
+Compile Elapsed Time                 0:00:00.000604
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -1668,11 +1680,11 @@ Stats Collection Type    PERTABLE_STATS
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -1703,11 +1715,11 @@ Last Suspend Time        -1
 Stats Collection Type    OPERATOR_STATS
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
 Execute Start Time       -1
 Execute End Time         -1
 Execute Elapsed Time                 0:00:00.000000
@@ -1754,14 +1766,14 @@ D
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1779,7 +1791,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1790,27 +1802,27 @@ Stats Collection Type    OPERATOR_STATS
 
 LC   RC   Id   PaId ExId Frag TDB Name                 DOP     Dispatches      Oper CPU Time  Est. Records Used  Act. Records Used    Details
 
-10   .    11   .    5    0    EX_ROOT                  1                5                 17                  0                  4 1049
-9    .    10   11   4    0    EX_SPLIT_TOP             1                5                  7                  2                  4
-8    .    9    10   4    0    EX_SEND_TOP              2               10              1,025                  2                  4
-7    .    8    9    4    2    EX_SEND_BOTTOM           2               21                 77                  2                  4
-6    .    7    8    4    2    EX_SPLIT_BOTTOM          2                7                  7                  2                  4 3223
-5    .    6    7    3    2    EX_HASH_GRBY             2                6              2,559                  1                  4 0|0|0
-4    .    5    6    2    2    EX_SPLIT_TOP             2               11                  8                100                  4
-3    .    4    5    2    2    EX_SEND_TOP              4               18                572                100                  4
-2    .    3    4    2    3    EX_SEND_BOTTOM           4               35                136                100                  4
-1    .    2    3    2    3    EX_SPLIT_BOTTOM          2                8                 11                100                  4 1377
-.    .    1    2    1    3    EX_TRAF_KEY_SELECT       6               12              3,690                100                  4 TRAFODION.SCH.TSTAT|4|176
-
---- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 ;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+10   .    11   .    5    0    EX_ROOT                  1                5                 10                  0                  4 1211
+9    .    10   11   4    0    EX_SPLIT_TOP             1                5                  8                  2                  4
+8    .    9    10   4    0    EX_SEND_TOP              2               10              1,193                  2                  4
+7    .    8    9    4    2    EX_SEND_BOTTOM           2               17                142                  2                  4
+6    .    7    8    4    2    EX_SPLIT_BOTTOM          2                7                  9                  2                  4 3732
+5    .    6    7    3    2    EX_HASH_GRBY             2                6              2,725                  1                  4 0|0|0
+4    .    5    6    2    2    EX_SPLIT_TOP             2                9                 13                100                  4
+3    .    4    5    2    2    EX_SEND_TOP              4               18                843                100                  4
+2    .    3    4    2    3    EX_SEND_BOTTOM           4               22                286                100                  4
+1    .    2    3    2    3    EX_SPLIT_BOTTOM          2                8                 22                100                  4 2126
+.    .    1    2    1    3    EX_TRAF_KEY_SELECT       6               12              5,454                100                  4 TRAFODION.SCH.TSTAT|4|176
+
+--- SQL operation complete.
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 ;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1828,7 +1840,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1839,31 +1851,31 @@ Stats Collection Type    OPERATOR_STATS
 
 LC   RC   Id   PaId ExId Frag TDB Name                 DOP     Dispatches      Oper CPU Time  Est. Records Used  Act. Records Used    Details
 
-10   .    11   .    5    0    EX_ROOT                  1                5                 17                  0                  4 1049
-9    .    10   11   4    0    EX_SPLIT_TOP             1                5                  7                  2                  4
-8    .    9    10   4    0    EX_SEND_TOP              2               10              1,025                  2                  4
-7    .    8    9    4    2    EX_SEND_BOTTOM           2               21                 77                  2                  4
-6    .    7    8    4    2    EX_SPLIT_BOTTOM          2                7                  7                  2                  4 3223
-5    .    6    7    3    2    EX_HASH_GRBY             2                6              2,559                  1                  4 0|0|0
-4    .    5    6    2    2    EX_SPLIT_TOP             2               11                  8                100                  4
-3    .    4    5    2    2    EX_SEND_TOP              4               18                572                100                  4
-2    .    3    4    2    3    EX_SEND_BOTTOM           4               35                136                100                  4
-1    .    2    3    2    3    EX_SPLIT_BOTTOM          2                8                 11                100                  4 1377
-.    .    1    2    1    3    EX_TRAF_KEY_SELECT       6               12              3,690                100                  4 TRAFODION.SCH.TSTAT|4|176
+10   .    11   .    5    0    EX_ROOT                  1                5                 10                  0                  4 1211
+9    .    10   11   4    0    EX_SPLIT_TOP             1                5                  8                  2                  4
+8    .    9    10   4    0    EX_SEND_TOP              2               10              1,193                  2                  4
+7    .    8    9    4    2    EX_SEND_BOTTOM           2               17                142                  2                  4
+6    .    7    8    4    2    EX_SPLIT_BOTTOM          2                7                  9                  2                  4 3732
+5    .    6    7    3    2    EX_HASH_GRBY             2                6              2,725                  1                  4 0|0|0
+4    .    5    6    2    2    EX_SPLIT_TOP             2                9                 13                100                  4
+3    .    4    5    2    2    EX_SEND_TOP              4               18                843                100                  4
+2    .    3    4    2    3    EX_SEND_BOTTOM           4               22                286                100                  4
+1    .    2    3    2    3    EX_SPLIT_BOTTOM          2                8                 22                100                  4 2126
+.    .    1    2    1    3    EX_TRAF_KEY_SELECT       6               12              5,454                100                  4 TRAFODION.SCH.TSTAT|4|176
 
 --- SQL operation complete.
 >>log;
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 ACCUMULATED;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 ACCUMULATED;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1881,7 +1893,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1893,19 +1905,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           2,387
-SQL Process Busy Time    5,649
+SE IO MAX Time           3,310
+SQL Process Busy Time    7,069
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,341                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    28
 Request Message Bytes    39,712
 Reply Message Count      15
-Reply Message Bytes      42,256
+Reply Message Bytes      42,416
 Scr. Overflow Mode       DISK
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -1915,14 +1928,14 @@ Scr. Read Count          0
 Scr. Write Count         0
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 ACCUMULATED;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 ACCUMULATED;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -1940,7 +1953,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -1952,19 +1965,20 @@ Accessed Rows            4
 Used Rows                4
 SE IOs                   4
 SE IO Bytes              176
-SE IO MAX Time           2,387
-SQL Process Busy Time    5,649
+SE IO MAX Time           3,310
+SQL Process Busy Time    7,069
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,341                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    28
 Request Message Bytes    39,712
 Reply Message Count      15
-Reply Message Bytes      42,256
+Reply Message Bytes      42,416
 Scr. Overflow Mode       DISK
 Scr. File Count          0
 Scr. Buffer Blk Size     0
@@ -1978,14 +1992,14 @@ Scr. Write Count         0
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 PERTABLE;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 PERTABLE;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -2003,7 +2017,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -2011,20 +2025,21 @@ No. of times reclaimed   0
 Cancel Time              -1
 Last Suspend Time        -1
 Stats Collection Type    OPERATOR_STATS
-SQL Process Busy Time    5,649
+SQL Process Busy Time    7,069
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,341                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    28
 Request Message Bytes    39,712
 Reply Message Count      15
-Reply Message Bytes      42,256
+Reply Message Bytes      42,416
 Scr. Overflow Mode       DISK
-Scr File Count           0
+Scr. File Count          0
 Scr. Buffer Blk Size     0
 Scr. Buffer Blks Read    0
 Scr. Buffer Blks Written 0
@@ -2032,22 +2047,22 @@ Scr. Read Count          0
 Scr. Write Count         0
 Sort TopN                -1
 
-Table Name
+       ID       DOP         Table Name
    Records Accessed       Records Used   HBase/Hive   HBase/Hive      HBase/Hive IO      HBase/Hive IO
    Estimated/Actual   Estimated/Actual          IOs    IO MBytes           Sum Time           Max Time
-TRAFODION.SCH.TSTAT
+        1         6   TRAFODION.SCH.TSTAT
                   0                100
-                  4                  4            4            0              4,503              2,387
+                  4                  4            4            0              6,523              3,310
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 PERTABLE;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 PERTABLE;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -2065,7 +2080,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -2073,20 +2088,21 @@ No. of times reclaimed   0
 Cancel Time              -1
 Last Suspend Time        -1
 Stats Collection Type    OPERATOR_STATS
-SQL Process Busy Time    5,649
+SQL Process Busy Time    7,069
 UDR Process Busy Time    0
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,341                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    28
 Request Message Bytes    39,712
 Reply Message Count      15
-Reply Message Bytes      42,256
+Reply Message Bytes      42,416
 Scr. Overflow Mode       DISK
-Scr File Count           0
+Scr. File Count          0
 Scr. Buffer Blk Size     0
 Scr. Buffer Blks Read    0
 Scr. Buffer Blks Written 0
@@ -2094,26 +2110,26 @@ Scr. Read Count          0
 Scr. Write Count         0
 Sort TopN                -1
 
-Table Name
+       ID       DOP         Table Name
    Records Accessed       Records Used   HBase/Hive   HBase/Hive      HBase/Hive IO      HBase/Hive IO
    Estimated/Actual   Estimated/Actual          IOs    IO MBytes           Sum Time           Max Time
-TRAFODION.SCH.TSTAT
+        1         6   TRAFODION.SCH.TSTAT
                   0                100
-                  4                  4            4            0              4,503              2,387
+                  4                  4            4            0              6,523              3,310
 
 --- SQL operation complete.
 >>log;
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 PROGRESS;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 PROGRESS;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -2131,7 +2147,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -2139,41 +2155,42 @@ No. of times reclaimed   0
 Cancel Time              -1
 Last Suspend Time        -1
 Stats Collection Type    OPERATOR_STATS
-SQL Process Busy Time    5,649
+SQL Process Busy Time    7,069
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,341                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    28
 Request Message Bytes    39,712
 Reply Message Count      15
-Reply Message Bytes      42,256
+Reply Message Bytes      42,416
 
-Table Name
+       ID       DOP         Table Name
    Records Accessed       Records Used   HBase/Hive   HBase/Hive      HBase/Hive IO      HBase/Hive IO
    Estimated/Actual   Estimated/Actual          IOs    IO MBytes           Sum Time           Max Time
-TRAFODION.SCH.TSTAT
+        1         6   TRAFODION.SCH.TSTAT
                   0                100
-                  4                  4            4            0              4,503              2,387
+                  4                  4            4            0              6,523              3,310
 
-   Id         TDB Name                Mode                TopN            CPU Time          File Count
-         BMO Heap Used      BMO Heap Total         BMO Heap WM     BMO Space BufSz    BMO Space BufCnt
-           ScrBlk Size         ScrBlk Read      ScrBlk Written          ScrIO Read       ScrIO Written
-    6     EX_HASH_GRBY                DISK                  -1               2,559                   0
-                     4               1,024               7,687                 256                   0
-                    -1                   0                   0                   0                   0
+   Id           TDB Name               Mode       DOP     TopN            CPU Time          File Count
+           BMO Heap Used     BMO Heap Total        BMO Heap WM     BMO Space BufSz    BMO Space BufCnt
+ Size        ScrBlk Read     ScrBlk Written         ScrIO Read       ScrIO Written          ScrIO Time
+    6       EX_HASH_GRBY               DISK         2       -1               2,725                   0
+                       0                  0                  0                 256                   0
+   -1                  0                  0                  0                   0                   0
 
 --- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 PROGRESS;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+>>get statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 PROGRESS;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -2191,7 +2208,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -2199,45 +2216,46 @@ No. of times reclaimed   0
 Cancel Time              -1
 Last Suspend Time        -1
 Stats Collection Type    OPERATOR_STATS
-SQL Process Busy Time    5,649
+SQL Process Busy Time    7,069
 SQL Space Allocated      896                       KB
 SQL Space Used           766                       KB
-SQL Heap Allocated       135                       KB
-SQL Heap Used            14                        KB
+SQL Heap Allocated       200                       KB
+SQL Heap Used            78                        KB
+SQL Heap WM              10,341                    KB
 Processes Created        0
 Process Create Time      0
 Request Message Count    28
 Request Message Bytes    39,712
 Reply Message Count      15
-Reply Message Bytes      42,256
+Reply Message Bytes      42,416
 
-Table Name
+       ID       DOP         Table Name
    Records Accessed       Records Used   HBase/Hive   HBase/Hive      HBase/Hive IO      HBase/Hive IO
    Estimated/Actual   Estimated/Actual          IOs    IO MBytes           Sum Time           Max Time
-TRAFODION.SCH.TSTAT
+        1         6   TRAFODION.SCH.TSTAT
                   0                100
-                  4                  4            4            0              4,503              2,387
+                  4                  4            4            0              6,523              3,310
 
-   Id         TDB Name                Mode                TopN            CPU Time          File Count
-         BMO Heap Used      BMO Heap Total         BMO Heap WM     BMO Space BufSz    BMO Space BufCnt
-           ScrBlk Size         ScrBlk Read      ScrBlk Written          ScrIO Read       ScrIO Written
-    6     EX_HASH_GRBY                DISK                  -1               2,559                   0
-                     4               1,024               7,687                 256                   0
-                    -1                   0                   0                   0                   0
+   Id           TDB Name               Mode       DOP     TopN            CPU Time          File Count
+           BMO Heap Used     BMO Heap Total        BMO Heap WM     BMO Space BufSz    BMO Space BufCnt
+ Size        ScrBlk Read     ScrBlk Written         ScrIO Read       ScrIO Written          ScrIO Time
+    6       EX_HASH_GRBY               DISK         2       -1               2,725                   0
+                       0                  0                  0                 256                   0
+   -1                  0                  0                  0                   0                   0
 
 --- SQL operation complete.
 >>log;
 >>SET SESSION DEFAULT STATISTICS_VIEW_TYPE 'DEFAULT' ;
 
 --- SQL operation complete.
->>display statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 DEFAULT;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+>>display statistics for QID MXID11000006521212357413143091999000000000206U3333300_612_S1 DEFAULT;
+Qid                      MXID11000006521212357413143091999000000000206U3333300_612_S1
+Compile Start Time       2017/03/27 22:20:21.762150
+Compile End Time         2017/03/27 22:20:21.795421
+Compile Elapsed Time                 0:00:00.033271
+Execute Start Time       2017/03/27 22:20:25.191770
+Execute End Time         2017/03/27 22:20:25.204461
+Execute Elapsed Time                 0:00:00.012691
 State                    CLOSE
 Rows Affected            0
 SQL Error Code           100
@@ -2255,7 +2273,7 @@ Transaction Id           -1
 Source String            select distinct d from tstat ;
 SQL Source Length        30
 Rows Returned            4
-First Row Returned Time  2017/02/16 01:03:28.206366
+First Row Returned Time  2017/03/27 22:20:25.202687
 Last Error before AQR    0
 Number of AQR retries    0
 Delay before AQR         0
@@ -2266,27 +2284,27 @@ Stats Collection Type    OPERATOR_STATS
 
 LC   RC   Id   PaId ExId Frag TDB Name                 DOP     Dispatches      Oper CPU Time  Est. Records Used  Act. Records Used    Details
 
-10   .    11   .    5    0    EX_ROOT                  1                5                 17                  0                  4 1049
-9    .    10   11   4    0    EX_SPLIT_TOP             1                5                  7                  2                  4
-8    .    9    10   4    0    EX_SEND_TOP              2               10              1,025                  2                  4
-7    .    8    9    4    2    EX_SEND_BOTTOM           2               21                 77                  2                  4
-6    .    7    8    4    2    EX_SPLIT_BOTTOM          2                7                  7                  2                  4 3223
-5    .    6    7    3    2    EX_HASH_GRBY             2                6              2,559                  1                  4 0|0|0
-4    .    5    6    2    2    EX_SPLIT_TOP             2               11                  8                100                  4
-3    .    4    5    2    2    EX_SEND_TOP              4               18                572                100                  4
-2    .    3    4    2    3    EX_SEND_BOTTOM           4               35                136                100                  4
-1    .    2    3    2    3    EX_SPLIT_BOTTOM          2                8                 11                100                  4 1377
-.    .    1    2    1    3    EX_TRAF_KEY_SELECT       6               12              3,690                100                  4 TRAFODION.SCH.TSTAT|4|176
-
---- SQL operation complete.
->>get statistics for QID MXID11000027092212353966950645999000000000206U3333300_336_S1 DEFAULT;
-Qid                      MXID11000027092212353966950645999000000000206U3333300_336_S1
-Compile Start Time       2017/02/16 01:03:25.061984
-Compile End Time         2017/02/16 01:03:25.102150
-Compile Elapsed Time                 0:00:00.040166
-Execute Start Time       2017/02/16 01:03:28.196863
-Execute End Time         2017/02/16 01:03:28.208332
-Execute Elapsed Time                 0:00:00.011469
+10   .    11   .    5    0    EX_ROOT                  1                5                 10                  0                  4 1211
+9    .    10   11   4    0    EX_SPLIT_TOP             1                5                  8                  2                  4
+8    .    9    10   4    0    EX_SEND_TOP              2               10              1,193                  2                  4
+7    .    8    9    4    2    EX_SEND_BOTTOM           2               17                142                  2                  4
+6    .    7    8    4    2    EX_SPLIT_BOTTOM          2                7                  9                  2                  4 3732
+5    .    6    7    3    2    EX_HASH_GRBY             2                6           

<TRUNCATED>


[6/6] incubator-trafodion git commit: Merge [TRAFODION-2420] PR-1027 RMS Enhancements

Posted by su...@apache.org.
Merge [TRAFODION-2420] PR-1027 RMS Enhancements


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/4716b3ae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/4716b3ae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/4716b3ae

Branch: refs/heads/master
Commit: 4716b3ae2f499b49410338aa2d0ab1e43fd97de8
Parents: 9b3c71e b0e067d
Author: Suresh Subbiah <su...@apache.org>
Authored: Tue Mar 28 20:56:27 2017 +0000
Committer: Suresh Subbiah <su...@apache.org>
Committed: Tue Mar 28 20:56:27 2017 +0000

----------------------------------------------------------------------
 .../java/org/trafodion/ci/DatabaseQuery.java    |    6 +-
 core/sql/cli/Statement.cpp                      |    4 +-
 core/sql/cli/sqlcli.h                           |    4 +-
 core/sql/comexe/ComTdbExeUtil.h                 |    7 +-
 core/sql/executor/ExExeUtil.h                   |    4 +-
 core/sql/executor/ExExeUtilGetStats.cpp         |  564 +++---
 core/sql/executor/ExStats.cpp                   |  661 ++-----
 core/sql/executor/ExStats.h                     |  150 +-
 core/sql/generator/GenRelExeUtil.cpp            |    2 +-
 core/sql/optimizer/RelExeUtil.cpp               |    7 +-
 core/sql/optimizer/RelExeUtil.h                 |    2 +
 core/sql/parser/sqlparser.y                     |    4 +-
 core/sql/regress/core/EXPECTEDRTS               | 1835 +++++++++---------
 core/sql/regress/core/FILTERRTS                 |   18 +-
 core/sql/regress/core/TESTRTS                   |    1 +
 core/sql/sort/scratchfile_sq.cpp                |   16 +-
 core/sql/sqlci/SqlciStats.cpp                   |    6 +-
 17 files changed, 1486 insertions(+), 1805 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/4716b3ae/core/sql/generator/GenRelExeUtil.cpp
----------------------------------------------------------------------


[5/6] incubator-trafodion git commit: [TRAFODION-2420] RMS enhancements

Posted by su...@apache.org.
[TRAFODION-2420] RMS enhancements

Fix for core/TESTRTS failure


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/b0e067de
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/b0e067de
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/b0e067de

Branch: refs/heads/master
Commit: b0e067de27fe1114dfbd4b7c28e4347337c61e5c
Parents: ae3eca8
Author: selvaganesang <se...@esgyn.com>
Authored: Tue Mar 28 05:06:41 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Tue Mar 28 05:06:41 2017 +0000

----------------------------------------------------------------------
 core/sql/regress/core/FILTERRTS | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b0e067de/core/sql/regress/core/FILTERRTS
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/FILTERRTS b/core/sql/regress/core/FILTERRTS
index 870ca4a..ea88a79 100755
--- a/core/sql/regress/core/FILTERRTS
+++ b/core/sql/regress/core/FILTERRTS
@@ -7,8 +7,12 @@ if [ "$fil" = "" ]; then
 fi
 sed  "
 /SE IOs  SE IO Bytes/{N
-s/[A-Z0-9 ,]*\.[A-Z0-9]*\.TSTAT/#CAT.#SCH.TSTAT pertableStats/
+s/[A-Z0-9 ,-]*\.[A-Z0-9]*\.TSTAT/#CAT.#SCH.TSTAT pertableStats/
 }
+/6       EX_HASH_GRBY/{N
+s/6       EX_HASH_GRBY[ ]*[A-Z0-9 ,-]*\n/hash_grby_stats/
+}
+s/hash_grby_stats[0-9 ,]*/@hash_grby_stats@/
 s/QID[ ]*MXID[A-Z0-9_]*/QID @QID@/
 s/QID[ ]*'MXID[A-Z0-9_]*'/QID '@QID@'/
 s/Qid[ ]*MXID[A-Z0-9_]*/Qid @QID@/