feat: optimize encode/decode resultRow

This commit is contained in:
wangmm0220 2022-04-11 17:30:27 +08:00
parent 4961b6ab8e
commit 78fd2d3a3e
1 changed files with 6 additions and 5 deletions

View File

@ -4974,6 +4974,7 @@ static int32_t doOpenAggregateOptr(SOperatorInfo* pOperator) {
setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order); setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order);
doAggregateImpl(pOperator, 0, pInfo->pCtx); doAggregateImpl(pOperator, 0, pInfo->pCtx);
#if 0 // test for encode/decode result info
if(pOperator->encodeResultRow){ if(pOperator->encodeResultRow){
char *result = NULL; char *result = NULL;
int32_t length = 0; int32_t length = 0;
@ -4986,7 +4987,7 @@ static int32_t doOpenAggregateOptr(SOperatorInfo* pOperator) {
taosMemoryFree(result); taosMemoryFree(result);
} }
} }
#endif
} }
finalizeQueryResult(pInfo->pCtx, pOperator->numOfOutput); finalizeQueryResult(pInfo->pCtx, pOperator->numOfOutput);
@ -5036,10 +5037,10 @@ void aggEncodeResultRow(SOperatorInfo* pOperator, SAggSupporter *pSup, SOptrBasi
void* pIter = taosHashIterate(pSup->pResultRowHashTable, NULL); void* pIter = taosHashIterate(pSup->pResultRowHashTable, NULL);
while (pIter) { while (pIter) {
void* key = taosHashGetKey(pIter, &keyLen); void* key = taosHashGetKey(pIter, &keyLen);
SResultRowPosition** p1 = (SResultRowPosition**)pIter; SResultRowPosition* p1 = (SResultRowPosition*)pIter;
pPage = (SFilePage*) getBufPage(pSup->pResultBuf, (*p1)->pageId); pPage = (SFilePage*) getBufPage(pSup->pResultBuf, p1->pageId);
pRow = (SResultRow*)((char*)pPage + (*p1)->offset); pRow = (SResultRow*)((char*)pPage + p1->offset);
setBufPageDirty(pPage, true); setBufPageDirty(pPage, true);
releaseBufPage(pSup->pResultBuf, pPage); releaseBufPage(pSup->pResultBuf, pPage);
@ -5346,7 +5347,7 @@ static int32_t doOpenIntervalAgg(SOperatorInfo* pOperator) {
setInputDataBlock(pOperator, pInfo->binfo.pCtx, pBlock, order); setInputDataBlock(pOperator, pInfo->binfo.pCtx, pBlock, order);
hashIntervalAgg(pOperator, &pInfo->binfo.resultRowInfo, pBlock, 0); hashIntervalAgg(pOperator, &pInfo->binfo.resultRowInfo, pBlock, 0);
#if 0 #if 0 // test for encode/decode result info
if(pOperator->encodeResultRow){ if(pOperator->encodeResultRow){
char *result = NULL; char *result = NULL;
int32_t length = 0; int32_t length = 0;