Yes, it is syntax simpler than the traditional Group By Union approach. The key performance advantage is that BigQuery can optimize the GROUP BY GROUPING SETS
operation to scan the source table only once. The GROUP BY UNION ALL
approach typically requires BigQuery to scan the source table multiple times, once for each GROUP BY
clause within the UNION ALL
. This can lead to significantly longer processing times, especially for large datasets.