hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hubertzh...@apache.org
Subject [1/4] incubator-hawq git commit: HAWQ-673. Unify out put of explain analyze.
Date Thu, 14 Apr 2016 07:49:06 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master a60a54e5d -> 8ba02a818


HAWQ-673. Unify out put of explain analyze.


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

Branch: refs/heads/master
Commit: cbf85995d93b04c9f2d41a83c0afac2639f21297
Parents: bcd2b56
Author: hzhang2 <zhanghuan929@163.com>
Authored: Thu Apr 14 14:34:47 2016 +0800
Committer: hzhang2 <zhanghuan929@163.com>
Committed: Thu Apr 14 15:25:03 2016 +0800

----------------------------------------------------------------------
 src/backend/cdb/cdbexplain.c |  6 ++++--
 src/include/cdb/cdbexplain.h | 14 ++++++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cbf85995/src/backend/cdb/cdbexplain.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbexplain.c b/src/backend/cdb/cdbexplain.c
index 6ddb095..f20a7e5 100644
--- a/src/backend/cdb/cdbexplain.c
+++ b/src/backend/cdb/cdbexplain.c
@@ -305,6 +305,8 @@ cdbexplain_localExecStats(struct PlanState                 *planstate,
     ctx.send.notebuf = &showstatctx->extratextbuf;
 
     /* Set up a temporary StatHdr for both collecting and depositing stats. */
+    gethostname(ctx.send.hdr.hostname,SEGMENT_IDENTITY_NAME_LENGTH-1);
+    //strncpy(ctx.send.hdr.hostname,gethostname(),SEGMENT_IDENTITY_NAME_LENGTH-1);
     ctx.msgptrs[0] = &ctx.send.hdr;
     ctx.send.hdr.segindex = GetQEIndex();
     ctx.send.hdr.nInst = 1;
@@ -921,7 +923,7 @@ cdbexplain_depStatAcc_upd(CdbExplain_DepStatAcc    *acc,
         acc->nsimax = nsi;
     }
 
-    if (acc->max_total < nsi->total)
+    if (acc->max_total <= nsi->total)
     {
 		acc->rshLast = rsh;
 		acc->rsiLast = rsi;
@@ -1424,7 +1426,7 @@ cdbexplain_formatSegNoParenthesis(char *outbuf, int bufsize, int segindex,
int n
 	Assert(outbuf != NULL &&  "CDBEXPLAIN: char buffer is null");
 	Assert(bufsize > 0 &&  "CDBEXPLAIN: size of char buffer is zero");
 
-    if ( nInst >= 0 && segindex >= 0){
+    if ( nInst >= 0 && segindex >= -1){
     	/*check if truncation occurs */
 #ifdef USE_ASSERT_CHECKING
     	int nchars_written =

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cbf85995/src/include/cdb/cdbexplain.h
----------------------------------------------------------------------
diff --git a/src/include/cdb/cdbexplain.h b/src/include/cdb/cdbexplain.h
index 8dde233..719eb38 100644
--- a/src/include/cdb/cdbexplain.h
+++ b/src/include/cdb/cdbexplain.h
@@ -74,12 +74,22 @@ cdbexplain_agg_init1(CdbExplain_Agg *agg, double v, int id)
 static inline bool
 cdbexplain_agg_upd(CdbExplain_Agg *agg, double v, int id,char* hostname)
 {
-    if (v > 0)
+    /*if(v == 0){
+      if (agg->vcnt == 0)
+        {
+            agg->vmax = v;
+            agg->imax = id;
+            if(hostname!=NULL)
+                strncpy(agg->hostnamemax, hostname,SEGMENT_IDENTITY_NAME_LENGTH-1);
+            return true;
+        }
+    }
+    else */if (v > 0)
     {
         agg->vsum += v;
         agg->vcnt++;
 
-        if (v > agg->vmax ||
+        if (v >= agg->vmax ||
             agg->vcnt == 0)
         {
             agg->vmax = v;


Mime
View raw message