optimize execution plan if group by is on clustered by column

pls add a docstring