enh(query): improve the perf.
This commit is contained in:
parent
f85d66f5ee
commit
6e1a2b1e54
|
@ -957,11 +957,15 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn
|
||||||
int32_t i = 0;
|
int32_t i = 0;
|
||||||
SColumnInfoData* pColData = taosArrayGet(pResBlock->pDataBlock, i);
|
SColumnInfoData* pColData = taosArrayGet(pResBlock->pDataBlock, i);
|
||||||
if (pColData->info.colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
|
if (pColData->info.colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
|
||||||
if (asc) {
|
memcpy(pColData->pData, &pBlockData->aTSKEY[pDumpInfo->rowIndex], remain * sizeof(int64_t));
|
||||||
memcpy(pColData->pData, &pBlockData->aTSKEY[pDumpInfo->rowIndex], remain * sizeof(int64_t));
|
|
||||||
} else {
|
if (!asc) { // reverse the array list
|
||||||
for (int32_t j = pDumpInfo->rowIndex; rowIndex < remain; j += step) {
|
int32_t mid = remain / 2;
|
||||||
colDataAppendInt64(pColData, rowIndex++, &pBlockData->aTSKEY[j]);
|
TSKEY* pts = (int64_t*)pColData->pData;
|
||||||
|
for (int32_t j = 0; j < mid; ++j) {
|
||||||
|
int64_t t = pts[i];
|
||||||
|
pts[j] = pts[remain - j - 1];
|
||||||
|
pts[remain - j - 1] = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3103,8 +3103,9 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// save selectivity value for column consisted of all null values
|
||||||
if (numOfElems == 0) {
|
if (numOfElems == 0) {
|
||||||
// save selectivity value for column consisted of all null values
|
|
||||||
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
||||||
}
|
}
|
||||||
SET_VAL(pResInfo, numOfElems, 1);
|
SET_VAL(pResInfo, numOfElems, 1);
|
||||||
|
|
Loading…
Reference in New Issue