diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index e9a1089268b09e3197e50d9385b8ea0374b6ebfb..3d5e19ccd3c0a7dd2df730b825d12197c1ef0a52 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -2874,7 +2874,7 @@ void doSetFilterColumnInfo(SSingleColumnFilterInfo* pFilterInfo, int32_t numOfFi int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTableScanInfo, SSDataBlock* pBlock, uint32_t* status) { *status = BLK_DATA_NO_NEEDED; - pBlock->pDataBlock = NULL; + pBlock->pDataBlock = NULL; pBlock->pBlockStatis = NULL; SQueryAttr* pQueryAttr = pRuntimeEnv->pQueryAttr; @@ -2884,6 +2884,9 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTa SQInfo* pQInfo = pRuntimeEnv->qinfo; SQueryCostInfo* pCost = &pQInfo->summary; + pCost->totalBlocks += 1; + pCost->totalRows += pBlock->info.rows; + if (pRuntimeEnv->pTsBuf != NULL) { (*status) = BLK_DATA_ALL_NEEDED; diff --git a/src/query/src/queryMain.c b/src/query/src/queryMain.c index 7d30f7c66812c0feb9c7ac37db9d7330fc2f37fb..878698752fe8b3bfa8c535745d4bcddd3baf7a01 100644 --- a/src/query/src/queryMain.c +++ b/src/query/src/queryMain.c @@ -199,7 +199,6 @@ int32_t qCreateQueryInfo(void* tsdb, int32_t vgId, SQueryTableMsg* pQueryMsg, qi return code; } - bool qTableQuery(qinfo_t qinfo, uint64_t *qId) { SQInfo *pQInfo = (SQInfo *)qinfo; assert(pQInfo && pQInfo->signature == pQInfo); @@ -240,7 +239,11 @@ bool qTableQuery(qinfo_t qinfo, uint64_t *qId) { bool newgroup = false; publishOperatorProfEvent(pRuntimeEnv->proot, QUERY_PROF_BEFORE_OPERATOR_EXEC); + + int64_t st = taosGetTimestampUs(); pRuntimeEnv->outputBuf = pRuntimeEnv->proot->exec(pRuntimeEnv->proot, &newgroup); + pQInfo->summary.elapsedTime += (taosGetTimestampUs() - st); + publishOperatorProfEvent(pRuntimeEnv->proot, QUERY_PROF_AFTER_OPERATOR_EXEC); pRuntimeEnv->resultInfo.total += GET_NUM_OF_RESULTS(pRuntimeEnv);