fix(query): set the max rows as the default block buffer rows.
This commit is contained in:
parent
17f05c0020
commit
c8f1c3b6e4
|
@ -423,22 +423,6 @@ static STimeWindow updateQueryTimeWindow(STsdb* pTsdb, STimeWindow* pWindow) {
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
// note: currently not need this limitation
|
|
||||||
static void limitOutputBufferSize(const SQueryTableDataCond* pCond, int32_t* capacity) {
|
|
||||||
#if 0
|
|
||||||
int32_t rowLen = 0;
|
|
||||||
for (int32_t i = 0; i < pCond->numOfCols; ++i) {
|
|
||||||
rowLen += pCond->colList[i].bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure the output SSDataBlock size be less than 2MB.
|
|
||||||
const int32_t TWOMB = 2 * 1024 * 1024;
|
|
||||||
if ((*capacity) * rowLen > TWOMB) {
|
|
||||||
(*capacity) = TWOMB / rowLen;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// init file iterator
|
// init file iterator
|
||||||
static int32_t initFilesetIterator(SFilesetIter* pIter, SArray* aDFileSet, STsdbReader* pReader) {
|
static int32_t initFilesetIterator(SFilesetIter* pIter, SArray* aDFileSet, STsdbReader* pReader) {
|
||||||
size_t numOfFileset = taosArrayGetSize(aDFileSet);
|
size_t numOfFileset = taosArrayGetSize(aDFileSet);
|
||||||
|
@ -621,8 +605,6 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
limitOutputBufferSize(pCond, &pReader->capacity);
|
|
||||||
|
|
||||||
// allocate buffer in order to load data blocks from file
|
// allocate buffer in order to load data blocks from file
|
||||||
SBlockLoadSuppInfo* pSup = &pReader->suppInfo;
|
SBlockLoadSuppInfo* pSup = &pReader->suppInfo;
|
||||||
pSup->pColAgg = taosArrayInit(pCond->numOfCols, sizeof(SColumnDataAgg));
|
pSup->pColAgg = taosArrayInit(pCond->numOfCols, sizeof(SColumnDataAgg));
|
||||||
|
@ -3837,11 +3819,9 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
|
||||||
pCond->twindows.ekey -= 1;
|
pCond->twindows.ekey -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t capacity = 0;
|
int32_t capacity = pVnode->config.tsdbCfg.maxRows;
|
||||||
if (pResBlock == NULL) {
|
if (pResBlock != NULL) {
|
||||||
capacity = pVnode->config.tsdbCfg.maxRows;
|
blockDataEnsureCapacity(pResBlock, capacity);
|
||||||
} else {
|
|
||||||
capacity = pResBlock->info.capacity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t code = tsdbReaderCreate(pVnode, pCond, ppReader, capacity, pResBlock, idstr);
|
int32_t code = tsdbReaderCreate(pVnode, pCond, ppReader, capacity, pResBlock, idstr);
|
||||||
|
|
|
@ -781,6 +781,10 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) {
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
T_LONG_JMP(pTaskInfo->env, code);
|
T_LONG_JMP(pTaskInfo->env, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pInfo->pResBlock->info.capacity > pOperator->resultInfo.capacity) {
|
||||||
|
pOperator->resultInfo.capacity = pInfo->pResBlock->info.capacity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SSDataBlock* result = doGroupedTableScan(pOperator);
|
SSDataBlock* result = doGroupedTableScan(pOperator);
|
||||||
|
@ -884,7 +888,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
|
||||||
|
|
||||||
initResultSizeInfo(&pOperator->resultInfo, 4096);
|
initResultSizeInfo(&pOperator->resultInfo, 4096);
|
||||||
pInfo->pResBlock = createDataBlockFromDescNode(pDescNode);
|
pInfo->pResBlock = createDataBlockFromDescNode(pDescNode);
|
||||||
blockDataEnsureCapacity(pInfo->pResBlock, pOperator->resultInfo.capacity);
|
// blockDataEnsureCapacity(pInfo->pResBlock, pOperator->resultInfo.capacity);
|
||||||
|
|
||||||
code = filterInitFromNode((SNode*)pTableScanNode->scan.node.pConditions, &pOperator->exprSupp.pFilterInfo, 0);
|
code = filterInitFromNode((SNode*)pTableScanNode->scan.node.pConditions, &pOperator->exprSupp.pFilterInfo, 0);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
|
Loading…
Reference in New Issue