Merge pull request #22685 from taosdata/fix/TS-3865
enh: upgrade more efficiently
This commit is contained in:
commit
c2c96c4456
|
@ -120,23 +120,7 @@ static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader *
|
||||||
};
|
};
|
||||||
|
|
||||||
if (dataBlk->hasDup) {
|
if (dataBlk->hasDup) {
|
||||||
tBlockDataReset(ctx->blockData);
|
record.count = 0;
|
||||||
|
|
||||||
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++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
code = tBrinBlockPut(ctx->brinBlock, &record);
|
code = tBrinBlockPut(ctx->brinBlock, &record);
|
||||||
|
|
Loading…
Reference in New Issue