提交 15bc41f5 编写于 作者: H Haojun Liao

[td-225] add query cost summary right before the qinfo is destoried.

上级 ceb92976
...@@ -3664,10 +3664,8 @@ int32_t doFillGapsInResults(SQueryRuntimeEnv* pRuntimeEnv, tFilePage **pDst, int ...@@ -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; SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv;
// SQuery *pQuery = pRuntimeEnv->pQuery;
SQueryCostInfo *pSummary = &pRuntimeEnv->summary; SQueryCostInfo *pSummary = &pRuntimeEnv->summary;
// if (pRuntimeEnv->pResultBuf == NULL) { // if (pRuntimeEnv->pResultBuf == NULL) {
//// pSummary->tmpBufferInDisk = 0; //// pSummary->tmpBufferInDisk = 0;
...@@ -4790,7 +4788,6 @@ static void tableQueryImpl(SQInfo *pQInfo) { ...@@ -4790,7 +4788,6 @@ static void tableQueryImpl(SQInfo *pQInfo) {
} }
qTrace("QInfo:%p query over, %d rows are returned", pQInfo, pQuery->rec.total); qTrace("QInfo:%p query over, %d rows are returned", pQInfo, pQuery->rec.total);
queryCostStatis(pQInfo);
return; return;
} }
...@@ -4822,10 +4819,6 @@ static void tableQueryImpl(SQInfo *pQInfo) { ...@@ -4822,10 +4819,6 @@ static void tableQueryImpl(SQInfo *pQInfo) {
} else {// todo set the table uid and tid in log } else {// todo set the table uid and tid in log
qTrace("QInfo:%p query paused, %" PRId64 " rows returned, numOfTotal:%" PRId64 " rows", qTrace("QInfo:%p query paused, %" PRId64 " rows returned, numOfTotal:%" PRId64 " rows",
pQInfo, pQuery->rec.rows, pQuery->rec.total + pQuery->rec.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: ...@@ -5877,6 +5870,9 @@ _over:
void qDestroyQueryInfo(qinfo_t pQInfo) { void qDestroyQueryInfo(qinfo_t pQInfo) {
qTrace("QInfo:%p query completed", pQInfo); qTrace("QInfo:%p query completed", pQInfo);
// print the query cost summary
queryCostStatis(pQInfo);
freeQInfo(pQInfo); freeQInfo(pQInfo);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册