Stop writing 5 queries in SQL when one ROLLUP does it all.
You're usually running separate queries for yearly, monthly, and daily totals.
GROUPING SETS, ROLLUP, and CUBE generate every aggregation level in a single query.
There is no need to use UNION ALL anymore!