[MONDRIAN-2086] optimize native sum by optimizing star columns and
removing unnecessary elements of the sql query.