I am making a dashboard system feature where i have a view for a specific report, the database I'm using is PostgreSQL. I plan to turn it to a materialized view to optimize it, but it will make the dashboard's data not real time, so i plan to refresh the materialized view every time the source table's data is updated. But, after reading the documentation here: https://www.postgresql.org/docs/current/sql-refreshmaterializedview.html
It said that REFRESH MATERIALIZED VIEW just completely replaces the contents of a materialized view, thus lowering the performance when updating the base table. That made me wonder, is there actually a good use for materialized views?
A materialized view is a tool that allows queries that would otherwise take too long to complete quickly, at the price of working with slightly stale data. You use it if you cannot find a better solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With