From 15bc41f5e328df040ccc6859815df81d3e57ace4 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 2 Jun 2020 18:16:36 +0800 Subject: [PATCH] [td-225] add query cost summary right before the qinfo is destoried. --- src/query/src/qExecutor.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 93a96eee13..2e9069bbf1 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -3664,10 +3664,8 @@ int32_t doFillGapsInResults(SQueryRuntimeEnv* pRuntimeEnv, tFilePage **pDst, int } } -void queryCostStatis(SQInfo *pQInfo) { +static void queryCostStatis(SQInfo *pQInfo) { SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv; -// SQuery *pQuery = pRuntimeEnv->pQuery; - SQueryCostInfo *pSummary = &pRuntimeEnv->summary; // if (pRuntimeEnv->pResultBuf == NULL) { //// pSummary->tmpBufferInDisk = 0; @@ -4790,7 +4788,6 @@ static void tableQueryImpl(SQInfo *pQInfo) { } qTrace("QInfo:%p query over, %d rows are returned", pQInfo, pQuery->rec.total); - queryCostStatis(pQInfo); return; } @@ -4822,10 +4819,6 @@ static void tableQueryImpl(SQInfo *pQInfo) { } else {// todo set the table uid and tid in log qTrace("QInfo:%p query paused, %" PRId64 " rows returned, numOfTotal:%" PRId64 " rows", pQInfo, pQuery->rec.rows, pQuery->rec.total + pQuery->rec.rows); - - if (Q_STATUS_EQUAL(pQuery->status, QUERY_COMPLETED)) { - queryCostStatis(pQInfo); - } } } @@ -5877,6 +5870,9 @@ _over: void qDestroyQueryInfo(qinfo_t pQInfo) { qTrace("QInfo:%p query completed", pQInfo); + + // print the query cost summary + queryCostStatis(pQInfo); freeQInfo(pQInfo); } -- GitLab