fix: do not performace table count scan optimized where there are no agg functions

This commit is contained in:
shenglian zhou 2023-04-20 13:54:22 +08:00
parent 989f1cdd4b
commit cc78a6356c
2 changed files with 8 additions and 1 deletions

View File

@ -2530,7 +2530,9 @@ static bool tbCntScanOptIsEligibleAggFuncs(SNodeList* pAggFuncs) {
}
static bool tbCntScanOptIsEligibleAgg(SAggLogicNode* pAgg) {
return tbCntScanOptIsEligibleGroupKeys(pAgg->pGroupKeys) && tbCntScanOptIsEligibleAggFuncs(pAgg->pAggFuncs);
return tbCntScanOptIsEligibleGroupKeys(pAgg->pGroupKeys) &&
(NULL != pAgg->pAggFuncs) &&
tbCntScanOptIsEligibleAggFuncs(pAgg->pAggFuncs);
}
static bool tbCntScanOptGetColValFromCond(SOperatorNode* pOper, SColumnNode** pCol, SValueNode** pVal) {

View File

@ -104,4 +104,9 @@ if $data62 != 5 then
return -1
endi
sql select distinct db_name from information_schema.ins_tables;
print $rows
if $rows != 4 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT