Merge pull request #15710 from taosdata/feature/3.0_query_optimize_wxy
enh: last_row function scan in reverse order
This commit is contained in:
commit
25fd22c2ff
|
@ -242,7 +242,7 @@ static int32_t scanPathOptGetScanOrder(SScanLogicNode* pScan, EScanOrder* pScanO
|
||||||
SFunctionNode* pFunc = (SFunctionNode*)pNode;
|
SFunctionNode* pFunc = (SFunctionNode*)pNode;
|
||||||
if (FUNCTION_TYPE_FIRST == pFunc->funcType) {
|
if (FUNCTION_TYPE_FIRST == pFunc->funcType) {
|
||||||
hasFirst = true;
|
hasFirst = true;
|
||||||
} else if (FUNCTION_TYPE_LAST == pFunc->funcType) {
|
} else if (FUNCTION_TYPE_LAST == pFunc->funcType || FUNCTION_TYPE_LAST_ROW == pFunc->funcType) {
|
||||||
hasLast = true;
|
hasLast = true;
|
||||||
} else if (FUNCTION_TYPE_SELECT_VALUE != pFunc->funcType) {
|
} else if (FUNCTION_TYPE_SELECT_VALUE != pFunc->funcType) {
|
||||||
otherFunc = true;
|
otherFunc = true;
|
||||||
|
@ -436,8 +436,8 @@ static int32_t pushDownCondOptDealScan(SOptimizeContext* pCxt, SScanLogicNode* p
|
||||||
|
|
||||||
SNode* pPrimaryKeyCond = NULL;
|
SNode* pPrimaryKeyCond = NULL;
|
||||||
SNode* pOtherCond = NULL;
|
SNode* pOtherCond = NULL;
|
||||||
int32_t code = filterPartitionCond(&pScan->node.pConditions, &pPrimaryKeyCond, &pScan->pTagIndexCond, &pScan->pTagCond,
|
int32_t code = filterPartitionCond(&pScan->node.pConditions, &pPrimaryKeyCond, &pScan->pTagIndexCond,
|
||||||
&pOtherCond);
|
&pScan->pTagCond, &pOtherCond);
|
||||||
if (TSDB_CODE_SUCCESS == code && NULL != pScan->pTagCond) {
|
if (TSDB_CODE_SUCCESS == code && NULL != pScan->pTagCond) {
|
||||||
code = pushDownCondOptRebuildTbanme(&pScan->pTagCond);
|
code = pushDownCondOptRebuildTbanme(&pScan->pTagCond);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue