skip empty result optimization

This commit is contained in:
factosea 2024-01-15 16:45:51 +08:00
parent 2c0dd3db03
commit a8efcfcce9
1 changed files with 4 additions and 4 deletions

View File

@ -4405,10 +4405,10 @@ static int32_t translateWhere(STranslateContext* pCxt, SSelectStmt* pSelect) {
if (TSDB_CODE_SUCCESS == code) {
code = getQueryTimeRange(pCxt, pSelect->pWhere, &pSelect->timeRange);
}
if (TSDB_CODE_SUCCESS == code && pSelect->timeRange.skey > pSelect->timeRange.ekey
&& (pSelect->pGroupByList == NULL || pSelect->pGroupByList->length == 0)) {
pSelect->isEmptyResult = true;
}
// skip optimization, because need result meta info.(tbnamecolname and so on)
// if (TSDB_CODE_SUCCESS == code && pSelect->timeRange.skey > pSelect->timeRange.ekey) {
// pSelect->isEmptyResult = true;
// }
if (pSelect->pWhere != NULL) {
setTableVgroupsFromEqualTbnameCond(pCxt, pSelect);
}