提交 851f6df0 编写于 作者: H Haojun Liao

enh(tsdb): opt perf.

上级 aeb94733
...@@ -997,18 +997,18 @@ void clearBrinBlockIter(SBrinRecordIter* pIter) { ...@@ -997,18 +997,18 @@ void clearBrinBlockIter(SBrinRecordIter* pIter) {
static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SBlockNumber* pBlockNum, SArray* pTableScanInfoList) { static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SBlockNumber* pBlockNum, SArray* pTableScanInfoList) {
size_t sizeInDisk = 0; size_t sizeInDisk = 0;
int64_t st = taosGetTimestampUs(); int64_t st = taosGetTimestampUs();
cleanupTableScanInfo(&pReader->status);
// set the flag for the new file // clear info for the new file
int32_t k = 0; cleanupTableScanInfo(&pReader->status);
int32_t numOfTables = tSimpleHashGetSize(pReader->status.pTableMap);
int32_t step = ASCENDING_TRAVERSE(pReader->order) ? 1 : -1; int32_t k = 0;
STimeWindow w = pReader->window; int32_t numOfTables = tSimpleHashGetSize(pReader->status.pTableMap);
int32_t step = ASCENDING_TRAVERSE(pReader->order) ? 1 : -1;
STimeWindow w = pReader->window;
SBrinRecord* pRecord = NULL;
SBrinRecordIter iter = {0}; SBrinRecordIter iter = {0};
initBrinRecordIter(&iter, pReader->pFileReader, pIndexList); initBrinRecordIter(&iter, pReader->pFileReader, pIndexList);
SBrinRecord* pRecord = NULL;
while (k < numOfTables) { while (k < numOfTables) {
pRecord = getNextBrinRecord(&iter); pRecord = getNextBrinRecord(&iter);
...@@ -1138,7 +1138,7 @@ static int32_t doCopyColVal(SColumnInfoData* pColInfoData, int32_t rowIndex, int ...@@ -1138,7 +1138,7 @@ static int32_t doCopyColVal(SColumnInfoData* pColInfoData, int32_t rowIndex, int
} }
static SFileDataBlockInfo* getCurrentBlockInfo(SDataBlockIter* pBlockIter) { static SFileDataBlockInfo* getCurrentBlockInfo(SDataBlockIter* pBlockIter) {
size_t num = taosArrayGetSize(pBlockIter->blockList); size_t num = TARRAY_SIZE(pBlockIter->blockList);
if (num == 0) { if (num == 0) {
ASSERT(pBlockIter->numOfBlocks == num); ASSERT(pBlockIter->numOfBlocks == num);
return NULL; return NULL;
...@@ -1669,7 +1669,7 @@ static int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIte ...@@ -1669,7 +1669,7 @@ static int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIte
for (int32_t i = 0; i < numOfTables; ++i) { for (int32_t i = 0; i < numOfTables; ++i) {
STableBlockScanInfo* pTableScanInfo = taosArrayGetP(pTableList, i); STableBlockScanInfo* pTableScanInfo = taosArrayGetP(pTableList, i);
ASSERT(pTableScanInfo->pBlockList != NULL && taosArrayGetSize(pTableScanInfo->pBlockList) > 0); // ASSERT(pTableScanInfo->pBlockList != NULL && taosArrayGetSize(pTableScanInfo->pBlockList) > 0);
size_t num = taosArrayGetSize(pTableScanInfo->pBlockList); size_t num = taosArrayGetSize(pTableScanInfo->pBlockList);
sup.numOfBlocksPerTable[sup.numOfTables] = num; sup.numOfBlocksPerTable[sup.numOfTables] = num;
...@@ -3251,7 +3251,7 @@ int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, int32_t orde ...@@ -3251,7 +3251,7 @@ int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, int32_t orde
int32_t code = 0; int32_t code = 0;
int32_t newDelDataInFile = taosArrayGetSize(pBlockScanInfo->pfileDelData); int32_t newDelDataInFile = taosArrayGetSize(pBlockScanInfo->pfileDelData);
if (newDelDataInFile == 0 && if (newDelDataInFile == 0 &&
((pBlockScanInfo->delSkyline != NULL) || (taosArrayGetSize(pBlockScanInfo->pMemDelData) == 0))) { ((pBlockScanInfo->delSkyline != NULL) || (TARRAY_SIZE(pBlockScanInfo->pMemDelData) == 0))) {
return code; return code;
} }
...@@ -5332,7 +5332,7 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock, ...@@ -5332,7 +5332,7 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock,
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
int64_t st = taosGetTimestampUs(); // int64_t st = taosGetTimestampUs();
TARRAY2_CLEAR(&pSup->colAggArray, 0); TARRAY2_CLEAR(&pSup->colAggArray, 0);
code = tsdbDataFileReadBlockSma(pReader->pFileReader, &pFBlock->record, &pSup->colAggArray); code = tsdbDataFileReadBlockSma(pReader->pFileReader, &pFBlock->record, &pSup->colAggArray);
...@@ -5389,8 +5389,8 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock, ...@@ -5389,8 +5389,8 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock,
*pBlockSMA = pResBlock->pBlockAgg; *pBlockSMA = pResBlock->pBlockAgg;
pReader->cost.smaDataLoad += 1; pReader->cost.smaDataLoad += 1;
double elapsedTime = (taosGetTimestampUs() - st) / 1000.0; // double elapsedTime = (taosGetTimestampUs() - st) / 1000.0;
pReader->cost.smaLoadTime += elapsedTime; pReader->cost.smaLoadTime += 0;//elapsedTime;
tsdbDebug("vgId:%d, succeed to load block SMA for uid %" PRIu64 ", %s", 0, pFBlock->uid, pReader->idStr); tsdbDebug("vgId:%d, succeed to load block SMA for uid %" PRIu64 ", %s", 0, pFBlock->uid, pReader->idStr);
return code; return code;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册