fix: add only meta ctb idx

This commit is contained in:
shenglian zhou 2023-08-15 22:31:23 +08:00
parent ca24607162
commit b21c177ce2
1 changed files with 12 additions and 3 deletions

View File

@ -367,15 +367,24 @@ static bool tagScanNodeHasTbname(SNode* pKeys) {
}
static int32_t setTagScanExecutionMode(SScanLogicNode* pScan) {
if (pScan->node.pConditions == NULL) {
//TODO: set pScan->onlyMetaCtbIdx
bool bOnlyMetaCtbIdx = false;
if (tagScanNodeListHasTbname(pScan->pScanPseudoCols)) {
bOnlyMetaCtbIdx = false;
return TSDB_CODE_SUCCESS;
}
if (pScan->node.pConditions == NULL) {
bOnlyMetaCtbIdx = true;
return TSDB_CODE_SUCCESS;
}
SNode* pCond = nodesCloneNode(pScan->node.pConditions);
SNode* pTagCond = NULL;
SNode* pTagIndexCond = NULL;
bool bOnlyMetaCtbIdx = false;
filterPartitionCond(&pCond, NULL, &pTagIndexCond, &pTagCond, NULL);
if (pTagIndexCond || tagScanNodeListHasTbname(pScan->pScanPseudoCols) || tagScanNodeHasTbname(pTagCond)) {
if (pTagIndexCond || tagScanNodeHasTbname(pTagCond)) {
bOnlyMetaCtbIdx = false;
} else {
bOnlyMetaCtbIdx = true;