未验证 提交 569eefd0 编写于 作者: M Minglei Jin 提交者: GitHub

Merge pull request #15500 from taosdata/fix/TS-1719-V26

first last and count combine aggregate is slower 
......@@ -2814,6 +2814,7 @@ static bool notContainSessionOrStateWindow(SQueryAttr *pQueryAttr) { return !(pQ
static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) {
bool hasFirstLastFunc = false;
bool hasOtherFunc = false;
bool hasCount = false;
if (status == BLK_DATA_ALL_NEEDED || status == BLK_DATA_DISCARD) {
return status;
......@@ -2829,6 +2830,8 @@ static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) {
if (functionId == TSDB_FUNC_FIRST_DST || functionId == TSDB_FUNC_LAST_DST) {
hasFirstLastFunc = true;
} else if(functionId == TSDB_FUNC_COUNT) {
hasCount = true;
} else {
hasOtherFunc = true;
}
......@@ -2836,7 +2839,7 @@ static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) {
if (hasFirstLastFunc && status == BLK_DATA_NO_NEEDED) {
if(!hasOtherFunc) {
return BLK_DATA_DISCARD;
return hasCount ? BLK_DATA_NO_NEEDED : BLK_DATA_DISCARD;
} else {
return BLK_DATA_ALL_NEEDED;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册