提交 8fbbaf03 编写于 作者: A Alex Duan

feat(tsdb): v24 the parent sql sum all subquery rows no lock on client

[TS-238]
上级 95ec2860
...@@ -85,12 +85,16 @@ void tscSubDeleteCallback(void *param, TAOS_RES *tres, int code) { ...@@ -85,12 +85,16 @@ void tscSubDeleteCallback(void *param, TAOS_RES *tres, int code) {
return; return;
} }
tscDebug("0x%"PRIx64":CDEL sub:0x%"PRIx64" query complete, ep:%s, vgId:%d, orderOfSub:%d, retrieve data", trsupport->pParentSql->self, tscInfo("0x%"PRIx64":CDEL sub:0x%"PRIx64" query complete, ep:%s, vgId:%d, orderOfSub:%d, retrieve row(s)=%d tables(s)=%d", trsupport->pParentSql->self,
pSql->self, pVgroup->epAddr[pSql->epSet.inUse].fqdn, pVgroup->vgId, trsupport->subqueryIndex); pSql->self, pVgroup->epAddr[pSql->epSet.inUse].fqdn, pVgroup->vgId, trsupport->subqueryIndex, pSql->res.numOfRows, pSql->res.numOfTables);
// success do total count // success do total count
SSubqueryState *subState = &pParentSql->subState;
pthread_mutex_lock(&subState->mutex);
pParentSql->res.numOfRows += pSql->res.numOfRows; pParentSql->res.numOfRows += pSql->res.numOfRows;
pParentSql->res.numOfTables += pSql->res.numOfTables; pParentSql->res.numOfTables += pSql->res.numOfTables;
pthread_mutex_unlock(&subState->mutex);
if (subAndCheckDone(pSql, pParentSql, trsupport->subqueryIndex)) { if (subAndCheckDone(pSql, pParentSql, trsupport->subqueryIndex)) {
// all sub done, call parentSQL callback to finish // all sub done, call parentSQL callback to finish
(*pParentSql->fp)(pParentSql->param, pParentSql, pParentSql->res.numOfRows); (*pParentSql->fp)(pParentSql->param, pParentSql, pParentSql->res.numOfRows);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册