Merge pull request #22685 from taosdata/fix/TS-3865

enh: upgrade more efficiently
This commit is contained in:
wade zhang 2023-09-01 11:15:13 +08:00 committed by GitHub
commit c2c96c4456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 17 deletions

View File

@ -120,23 +120,7 @@ static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader *
};
if (dataBlk->hasDup) {
tBlockDataReset(ctx->blockData);
int16_t aCid = 0;
STSchema tSchema = {0};
TABLEID tbid = {.suid = pBlockIdx->suid, .uid = pBlockIdx->uid};
code = tBlockDataInit(ctx->blockData, &tbid, &tSchema, &aCid, 0);
TSDB_CHECK_CODE(code, lino, _exit);
code = tsdbReadDataBlock(reader, dataBlk, ctx->blockData);
TSDB_CHECK_CODE(code, lino, _exit);
record.count = 1;
for (int32_t i = 1; i < ctx->blockData->nRow; ++i) {
if (ctx->blockData->aTSKEY[i] != ctx->blockData->aTSKEY[i - 1]) {
record.count++;
}
}
record.count = 0;
}
code = tBrinBlockPut(ctx->brinBlock, &record);