1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-3827 Optimize out sort on SubQuery in Select

This commit is contained in:
David Hall
2020-08-17 14:40:22 -05:00
parent 70f40210d0
commit e7b8abfdb9
2 changed files with 19 additions and 11 deletions

View File

@ -7790,12 +7790,16 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
}
}
if (ordercol->direction == ORDER::ORDER_ASC)
rc->asc(true);
else
rc->asc(false);
SimpleColumn* sc = dynamic_cast<SimpleColumn*>(rc);
if (!sc || sc->oid())
{
if (ordercol->direction == ORDER::ORDER_ASC)
rc->asc(true);
else
rc->asc(false);
gwi.orderByCols.push_back(SRCP(rc));
gwi.orderByCols.push_back(SRCP(rc));
}
}
}
// make sure columnmap, returnedcols and count(*) arg_list are not empty
@ -9582,12 +9586,16 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
}
}
if (ordercol->direction == ORDER::ORDER_ASC)
rc->asc(true);
else
rc->asc(false);
SimpleColumn* sc = dynamic_cast<SimpleColumn*>(rc);
if (!sc || sc->oid())
{
if (ordercol->direction == ORDER::ORDER_ASC)
rc->asc(true);
else
rc->asc(false);
gwi.orderByCols.push_back(SRCP(rc));
gwi.orderByCols.push_back(SRCP(rc));
}
}