Effectively Using Materialized Views in Ruby on Rails
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!<p>Two things that would help:<p>1. Getting Incremental View Maintenance (IVM) [1] into Postgres. It looks like work is beginning on this but it's been 7+ years coming. If there are any Postgres devs looking at this, I'm cheering for you!<p>2. There's a commercial group doing an implementation of this, Materialize [2], but they don't have any publicly released product yet. I mention it because their interview on Data Engineering Podcast is really good [3] and I really like their focus on correctness by working from replication logs.<p>[1] <a href="https://wiki.postgresql.org/wiki/Incremental_View_Maintenance" rel="nofollow">https://wiki.postgresql.org/wiki/Incremental_View_Maintenanc...</a><p>[2] <a href="https://materialize.io/" rel="nofollow">https://materialize.io/</a><p>[3] <a href="https://www.dataengineeringpodcast.com/materialize-streaming-analytics-episode-112/" rel="nofollow">https://www.dataengineeringpodcast.com/materialize-streaming...</a>