With PostgreSQL the materialized view won't be automatically updated though, you need to do `REFRESH MATERIALIZED VIEW` manually.
With PostgreSQL the materialized view won't be automatically updated though, you need to do `REFRESH MATERIALIZED VIEW` manually.
3rd party solutions like https://readyset.io/ and https://materialize.com/ exist specifically because databases don’t actually have what we all want materialized views to be.
I'm currently parking PostgREST behind Fastly (varnish) for pretty much the same benefits plus edge CDNs for my read APIs. I really just use materialized views for report generation now.
But I don't think there is anything similar in the GCP transactional db options like Spanner or CloudSQL.
It's important to understand how your implementation works before committing to it.
Now that would be awesome!
EDIT: come to think of it, it would require going through CDC stream, and figuring out if any of the tables affected are a dependency of given materialized view. Maybe with some ast parsing as well to handle tenants/partitions. Sounds like it can work?
At least on SQLAnywhere it seems to be implemented using triggers, ie not unlike what one would do if rolling your own.
https://oracle-base.com/articles/23/materialized-view-concur...
From the article: "Concurrent refreshes will only happen if there are no overlaps in the materialized view rows updated by each session."
I've found them VERY useful for a narrow range of use cases but, I probably don't realize what I'm missing.