Overall, I love this approach, but the big pain for me is the lack of incremental view refreshes. I end up needing to recreate giant tables each refresh even though the underlying changes are small. Sure I could implement that myself, but that sacrifices the correctness guarantees that materialized views provide! Two things that would help: 1. Getting Incremental View Maintenance (IVM) [1] into Postgres. It looks lik…
e.g. insert into rollup_clicks_hourly select hour, count(*) clicks from clicks where created_at >= ? and created_at
Then from a reporting perspective, users/dashboards/etc read from the highest relevant table that meets their criteria.