GROUP BY optimization allows the SQL engine to select index scan and to perform STREAM aggregation for GROUP BY columns. The two techniques of GROUP BY optimizations are as follows:
  • 1. Re-order GROUP BY columns
  • 2. Considering Equi-Constant Predicates