3 ms·
If materialized view doesn't refresh data on insert/update, this basically works similar to a cache. Caching the front page, server side, instead of rendering
by habibur 4y ago
If materialized view doesn't refresh data on insert/update, this basically works similar to a cache.
Caching the front page, server side, instead of rendering it on every request would have given similar result -- my guess. Specially when the query was taking 900ms.
- zdragnar 4y agoIf you only have a single application in front of it, that's a valid approach. If you have multiple applications- maybe a separate reporting tool, for example- you now have the problem of maintaining and invalidating multiple caches. Much easier to keep the cache located with the data since the cache changes when the data does.